blob: 6d1fb8320d5fa43774db096ac9a9266841f5ee27 [file] [log] [blame]
Mike Frysingere58c0e22017-10-04 15:43:30 -04001# -*- coding: utf-8 -*-
Dan Jacques2bcefd22015-05-18 14:57:00 -07002# 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
8from __future__ import print_function
9
Dan Jacques2bcefd22015-05-18 14:57:00 -070010import os
Mike Frysinger6a2b0f22020-02-20 13:34:07 -050011import sys
Dan Jacques2bcefd22015-05-18 14:57:00 -070012
Aviv Keshetb7519e12016-10-04 00:50:00 -070013from chromite.lib import constants
Dan Jacques2bcefd22015-05-18 14:57:00 -070014from chromite.lib import cros_test_lib
15from chromite.scripts import cros_show_waterfall_layout
16
Mike Frysinger6a2b0f22020-02-20 13:34:07 -050017
18assert sys.version_info >= (3, 6), 'This module requires Python 3.6+'
19
20
Dan Jacques2bcefd22015-05-18 14:57:00 -070021# pylint: disable=protected-access
22
23
Don Garrettd2a67112018-12-04 18:26:47 -080024class DumpTest(cros_test_lib.OutputTestCase):
25 """Test the dumping functionality of cros_show_waterfall_layout."""
Dan Jacques2bcefd22015-05-18 14:57:00 -070026
27 def setUp(self):
28 bin_name = os.path.basename(__file__).rstrip('_unittest.py')
29 self.bin_path = os.path.join(constants.CHROMITE_BIN_DIR, bin_name)
30
Dan Jacques2bcefd22015-05-18 14:57:00 -070031 def testTextDump(self):
32 """Make sure text dumping is capable of being produced."""
33 with self.OutputCapturer() as output:
Don Garrettd2a67112018-12-04 18:26:47 -080034 cros_show_waterfall_layout.main([])
Dan Jacques2bcefd22015-05-18 14:57:00 -070035 self.assertFalse(not output.GetStdout())