Skip to content

Commit 34cd23a

Browse files
100% coverage on CLI:hardware:power
1 parent 12227cb commit 34cd23a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/CLI/modules/server_tests.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,3 +454,11 @@ def test_rescue(self, confirm_mock):
454454
self.assert_no_fail(result)
455455
self.assertEqual(result.output, "")
456456
self.assert_called_with('SoftLayer_Hardware_Server', 'bootToRescueLayer', identifier=1000)
457+
458+
@mock.patch('SoftLayer.CLI.formatting.confirm')
459+
def test_server_rescue_negative(self, confirm_mock):
460+
confirm_mock.return_value = False
461+
result = self.run_command(['server', 'rescue', '1000'])
462+
463+
self.assertEqual(result.exit_code, 2)
464+
self.assertIsInstance(result.exception, exceptions.CLIAbort)

0 commit comments

Comments
 (0)