blob: 8fbd16024f686e2923d9f4f9916b29e8b7d1c38d [file] [log] [blame]
David Rochberg7c79a812011-01-19 14:24:45 -05001#!/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 Arnoldabb352e2012-09-23 01:24:27 -07005
David Rochberg7c79a812011-01-19 14:24:45 -05006import subprocess
7import unittest
8
9import builder
10
11
12class 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
22if __name__ == '__main__':
23 unittest.main()