Skip to content

Commit d87c4fe

Browse files
authored
Merge pull request #5 from vikumarks/work-json-support-platform-temp
Work json support platform temp
2 parents adaa2ec + e35b40a commit d87c4fe

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/show_platform_test.py

+20
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,26 @@ def test_summary(self):
5151
assert result.output == textwrap.dedent(expected_output)
5252

5353

54+
class TestShowPlatformTemperature(object):
55+
"""
56+
Note: `show platform temperature` simply calls the `tempershow` utility and
57+
passes a variety of options. Here we test that the utility is called
58+
with the appropriate option(s). The functionality of the underlying
59+
`tempershow` utility is expected to be tested by a separate suite of unit tests
60+
"""
61+
def test_temperature(self):
62+
with mock.patch('utilities_common.cli.run_command') as mock_run_command:
63+
CliRunner().invoke(show.cli.commands['platform'].commands['temperature'], [])
64+
assert mock_run_command.call_count == 1
65+
mock_run_command.assert_called_with(['tempershow'], display_cmd=False)
66+
67+
def test_all_temperature_json(self):
68+
with mock.patch('utilities_common.cli.run_command') as mock_run_command:
69+
CliRunner().invoke(show.cli.commands['platform'].commands['temperature'], ['--json'])
70+
assert mock_run_command.call_count == 1
71+
mock_run_command.assert_called_with(['tempershow', '-j'], display_cmd=False)
72+
73+
5474
class TestShowPlatformPsu(object):
5575
"""
5676
Note: `show platform psustatus` simply calls the `psushow` utility and

0 commit comments

Comments
 (0)