Skip to content

Commit d69142a

Browse files
author
Mike Place
committed
Fix status test
Correctly raise expected exception
1 parent bf95130 commit d69142a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/unit/modules/status_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ def test_uptime_return_success_not_supported(self):
145145
'''
146146
Test modules.status.uptime function for other platforms
147147
'''
148+
exc_mock = MagicMock(side_effect=CommandExecutionError)
148149
with self.assertRaises(CommandExecutionError):
149-
status.uptime()
150+
with patch.dict(status.__salt__, {'cmd.run': exc_mock}):
151+
status.uptime()
150152

151153

152154
if __name__ == '__main__':

0 commit comments

Comments
 (0)