mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #48564 from dwoz/test_prepend_fix
Fix failing prepend test
This commit is contained in:
commit
13f67335f3
1 changed files with 10 additions and 0 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Reference in a new issue