blob: a34f7c87baa22dc00e6751261a4ab5a9b614b0d3 [file] [log] [blame]
Mike Frysingera7f08bc2019-08-27 19:16:331#!/usr/bin/env python2
2# -*- coding: utf-8 -*-
David Rochberg7c79a812011-01-19 19:24:453# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
Gilad Arnoldabb352e2012-09-23 08:24:276
Don Garrettfb15e322016-06-22 02:12:087"""Unittests for builder.py."""
8
9from __future__ import print_function
10
David Rochberg7c79a812011-01-19 19:24:4511import subprocess
12import unittest
13
14import builder
15
Don Garrettfb15e322016-06-22 02:12:0816# pylint: disable=protected-access
David Rochberg7c79a812011-01-19 19:24:4517
18class BuilderTest(unittest.TestCase):
Don Garrettfb15e322016-06-22 02:12:0819 """Tests for builder."""
David Rochberg7c79a812011-01-19 19:24:4520 def testOutputOf(self):
21 self.assertRaises(subprocess.CalledProcessError,
22 builder._OutputOf, ['/bin/false'])
23
24 hello = 'hello, world'
25 self.assertEqual(hello + '\n',
26 builder._OutputOf(['/bin/echo', hello]))
27
28
29if __name__ == '__main__':
30 unittest.main()