mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Update file.touch unit tests to reflect addition of changes in test mode
This commit is contained in:
parent
4bc5fd008e
commit
885d6ff281
1 changed files with 6 additions and 2 deletions
|
@ -1357,14 +1357,18 @@ class TestFileState(TestCase, LoaderModuleMockMixin):
|
|||
with patch.object(os.path, 'exists', mock_f):
|
||||
with patch.dict(filestate.__opts__, {'test': True}):
|
||||
comt = ('File {0} is set to be created'.format(name))
|
||||
ret.update({'comment': comt, 'result': None})
|
||||
ret.update({'comment': comt,
|
||||
'result': None,
|
||||
'changes': {'new': name}})
|
||||
self.assertDictEqual(filestate.touch(name), ret)
|
||||
|
||||
with patch.dict(filestate.__opts__, {'test': False}):
|
||||
with patch.object(os.path, 'isdir', mock_f):
|
||||
comt = ('Directory not present to touch file {0}'
|
||||
.format(name))
|
||||
ret.update({'comment': comt, 'result': False})
|
||||
ret.update({'comment': comt,
|
||||
'result': False,
|
||||
'changes': {}})
|
||||
self.assertDictEqual(filestate.touch(name), ret)
|
||||
|
||||
with patch.object(os.path, 'isdir', mock_t):
|
||||
|
|
Loading…
Add table
Reference in a new issue