Mike Frysinger | f1ba7ad | 2022-09-12 05:42:57 -0400 | [diff] [blame] | 1 | # Copyright 2015 The ChromiumOS Authors |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Unittests for cros_show_waterfall_layout.""" |
| 6 | |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 7 | import os |
| 8 | |
Aviv Keshet | b7519e1 | 2016-10-04 00:50:00 -0700 | [diff] [blame] | 9 | from chromite.lib import constants |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 10 | from chromite.lib import cros_test_lib |
| 11 | from chromite.scripts import cros_show_waterfall_layout |
| 12 | |
Mike Frysinger | 6a2b0f2 | 2020-02-20 13:34:07 -0500 | [diff] [blame] | 13 | |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 14 | # pylint: disable=protected-access |
| 15 | |
| 16 | |
Don Garrett | d2a6711 | 2018-12-04 18:26:47 -0800 | [diff] [blame] | 17 | class DumpTest(cros_test_lib.OutputTestCase): |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 18 | """Test the dumping functionality of cros_show_waterfall_layout.""" |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 19 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 20 | def setUp(self): |
| 21 | bin_name = os.path.basename(__file__).rstrip("_unittest.py") |
Mike Frysinger | 164ec03 | 2023-03-27 16:15:14 -0400 | [diff] [blame] | 22 | self.bin_path = constants.CHROMITE_BIN_DIR / bin_name |
Dan Jacques | 2bcefd2 | 2015-05-18 14:57:00 -0700 | [diff] [blame] | 23 | |
Alex Klein | 1699fab | 2022-09-08 08:46:06 -0600 | [diff] [blame] | 24 | def testTextDump(self): |
| 25 | """Make sure text dumping is capable of being produced.""" |
| 26 | with self.OutputCapturer() as output: |
| 27 | cros_show_waterfall_layout.main([]) |
| 28 | self.assertFalse(not output.GetStdout()) |