mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Skip test that requires pywin32 on *nix platforms
This commit is contained in:
parent
45dce1a485
commit
18b1730320
@ -53,9 +53,10 @@ class TestEnvironState(TestCase, LoaderModuleMockMixin):
|
||||
ret = envstate.setenv('test', 'other')
|
||||
self.assertEqual(ret['changes'], {})
|
||||
|
||||
@skipIf(not utils.is_windows(), 'Windows only')
|
||||
def test_setenv_permanent(self):
|
||||
with patch.dict(envmodule.__salt__, {'reg.set_value': MagicMock(), 'reg.delete_value': MagicMock()}), \
|
||||
patch('salt.utils.is_windows', MagicMock(return_value=True)):
|
||||
'''test that we can set perminent environment variables (requires pywin32)'''
|
||||
with patch.dict(envmodule.__salt__, {'reg.set_value': MagicMock(), 'reg.delete_value': MagicMock()}):
|
||||
ret = envstate.setenv('test', 'value', permanent=True)
|
||||
self.assertEqual(ret['changes'], {'test': 'value'})
|
||||
envmodule.__salt__['reg.set_value'].assert_called_with("HKCU", "Environment", 'test', 'value')
|
||||
|
Loading…
Reference in New Issue
Block a user