David Rochberg | 7c79a81 | 2011-01-19 14:24:45 -0500 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
Gilad Arnold | abb352e | 2012-09-23 01:24:27 -0700 | [diff] [blame] | 5 | |
David Rochberg | 7c79a81 | 2011-01-19 14:24:45 -0500 | [diff] [blame] | 6 | import subprocess |
| 7 | import unittest |
| 8 | |
| 9 | import builder |
| 10 | |
| 11 | |
| 12 | class BuilderTest(unittest.TestCase): |
| 13 | def testOutputOf(self): |
| 14 | self.assertRaises(subprocess.CalledProcessError, |
| 15 | builder._OutputOf, ['/bin/false']) |
| 16 | |
| 17 | hello = 'hello, world' |
| 18 | self.assertEqual(hello + '\n', |
| 19 | builder._OutputOf(['/bin/echo', hello])) |
| 20 | |
| 21 | |
| 22 | if __name__ == '__main__': |
| 23 | unittest.main() |