mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Additional test case for question raised in #1846
https://github.com/saltstack/salt/issues/1864#issuecomment-102246258
This commit is contained in:
parent
9313804e27
commit
c4b15840c6
@ -1056,6 +1056,17 @@ class FileTest(integration.ModuleCase, integration.SaltReturnAssertsMixIn):
|
|||||||
'file.append', name=name, text='cheese', makedirs=True
|
'file.append', name=name, text='cheese', makedirs=True
|
||||||
)
|
)
|
||||||
self.assertSaltTrueReturn(ret)
|
self.assertSaltTrueReturn(ret)
|
||||||
|
finally:
|
||||||
|
if os.path.isfile(name):
|
||||||
|
os.remove(name)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Parent directory exists but file does not and makedirs is False
|
||||||
|
ret = self.run_state(
|
||||||
|
'file.append', name=name, text='cheese'
|
||||||
|
)
|
||||||
|
self.assertSaltTrueReturn(ret)
|
||||||
|
self.assertTrue(os.path.isfile(name))
|
||||||
finally:
|
finally:
|
||||||
shutil.rmtree(
|
shutil.rmtree(
|
||||||
os.path.join(integration.TMP, 'issue_1864'),
|
os.path.join(integration.TMP, 'issue_1864'),
|
||||||
|
Loading…
Reference in New Issue
Block a user