Mike Frysinger | e58c0e2 | 2017-10-04 15:43:30 -0400 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 2 | # Copyright 2015 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. |
| 5 | |
| 6 | """Unittests for cros_show_waterfall_layout.""" |
| 7 | |
| 8 | from __future__ import print_function |
| 9 | |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 10 | import os |
| 11 | |
Aviv Keshet | b7519e1 | 2016-10-04 00:50:00 -0700 | [diff] [blame] | 12 | from chromite.lib import constants |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 13 | from chromite.lib import cros_test_lib |
| 14 | from chromite.scripts import cros_show_waterfall_layout |
| 15 | |
| 16 | # pylint: disable=protected-access |
| 17 | |
| 18 | |
Don Garrett | d2a6711 | 2018-12-04 18:26:47 -0800 | [diff] [blame] | 19 | class DumpTest(cros_test_lib.OutputTestCase): |
| 20 | """Test the dumping functionality of cros_show_waterfall_layout.""" |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 21 | |
| 22 | def setUp(self): |
| 23 | bin_name = os.path.basename(__file__).rstrip('_unittest.py') |
| 24 | self.bin_path = os.path.join(constants.CHROMITE_BIN_DIR, bin_name) |
| 25 | |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 26 | def testTextDump(self): |
| 27 | """Make sure text dumping is capable of being produced.""" |
| 28 | with self.OutputCapturer() as output: |
Don Garrett | d2a6711 | 2018-12-04 18:26:47 -0800 | [diff] [blame] | 29 | cros_show_waterfall_layout.main([]) |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 30 | self.assertFalse(not output.GetStdout()) |