Merge pull request #48564 from dwoz/test_prepend_fix

Fix failing prepend test
This commit is contained in:
Daniel Wallace 2018-07-13 09:12:46 -05:00 committed by GitHub
commit 13f67335f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,6 +61,15 @@ class TestFileState(TestCase, LoaderModuleMockMixin):
}
}
def tearDown(self):
remove_dir = '/etc'
if salt.utils.is_windows():
remove_dir = 'c:\\etc'
try:
os.remove(remove_dir)
except OSError:
pass
def test_serialize(self):
def returner(contents, *args, **kwargs):
returner.returned = contents
@ -1174,6 +1183,7 @@ class TestFileState(TestCase, LoaderModuleMockMixin):
'''
Test to ensure that some text appears at the beginning of a file.
'''
assert not os.path.exists('c:\\etc')
name = '/etc/motd'
if salt.utils.is_windows():
name = 'c:\\etc\\motd'