mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix tests for get_hostname
This commit is contained in:
parent
7ca3fd7484
commit
d57a51f9f9
1 changed files with 2 additions and 2 deletions
|
@ -291,11 +291,11 @@ class WinSystemTestCase(TestCase):
|
|||
'''
|
||||
Test setting a new hostname
|
||||
'''
|
||||
cmd_run_mock = MagicMock(return_value="Name\nMINION")
|
||||
cmd_run_mock = MagicMock(return_value="MINION")
|
||||
with patch.dict(win_system.__salt__, {'cmd.run': cmd_run_mock}):
|
||||
ret = win_system.get_hostname()
|
||||
self.assertEqual(ret, "MINION")
|
||||
cmd_run_mock.assert_called_once_with(cmd="wmic computersystem get name")
|
||||
cmd_run_mock.assert_called_once_with(cmd="hostname")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Reference in a new issue