mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Add a test for issue 40578
This commit is contained in:
parent
3331aeafdd
commit
0d92e0a868
1
tests/integration/files/file/base/соль/спам.txt
Normal file
1
tests/integration/files/file/base/соль/спам.txt
Normal file
@ -0,0 +1 @@
|
||||
|
0
tests/integration/files/file/base/соль/яйца.txt
Normal file
0
tests/integration/files/file/base/соль/яйца.txt
Normal file
@ -1170,6 +1170,27 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin):
|
||||
finally:
|
||||
shutil.rmtree(name, ignore_errors=True)
|
||||
|
||||
def test_recurse_issue_40578(self):
|
||||
'''
|
||||
This ensures that the state doesn't raise an exception when it
|
||||
encounters a file with a unicode filename in the process of invoking
|
||||
file.source_list.
|
||||
'''
|
||||
issue_dir = 'issue-40578'
|
||||
name = os.path.join(TMP, issue_dir)
|
||||
|
||||
try:
|
||||
ret = self.run_state('file.recurse',
|
||||
name=name,
|
||||
source='salt://соль')
|
||||
self.assertSaltTrueReturn(ret)
|
||||
self.assertEqual(
|
||||
sorted(salt.utils.data.decode(os.listdir(name))),
|
||||
sorted(['foo.txt', 'спам.txt', 'яйца.txt'])
|
||||
)
|
||||
finally:
|
||||
shutil.rmtree(name, ignore_errors=True)
|
||||
|
||||
def test_replace(self):
|
||||
'''
|
||||
file.replace
|
||||
@ -2214,8 +2235,6 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin):
|
||||
'+마지막 행\n'
|
||||
)
|
||||
diff = salt.utils.stringutils.to_str(diff)
|
||||
# using unicode.encode('utf-8') we should get the same as
|
||||
# an utf-8 string
|
||||
# future_lint: disable=blacklisted-function
|
||||
expected = {
|
||||
str('file_|-some-utf8-file-create_|-{0}_|-managed').format(test_file_encoded): {
|
||||
|
Loading…
Reference in New Issue
Block a user