Additional test case for question raised in #1846

https://github.com/saltstack/salt/issues/1864#issuecomment-102246258
This commit is contained in:
Pedro Algarvio 2015-07-15 14:29:43 +01:00
parent 9313804e27
commit c4b15840c6

View File

@ -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'),