Skip to content

Commit

Permalink
Merge pull request #49362 from rallytime/bp-49240
Browse files Browse the repository at this point in the history
Back-port #49240 to 2018.3.3
  • Loading branch information
Nicole Thomas committed Aug 28, 2018
2 parents 9ca9a77 + 16ca5b9 commit b4a1e1d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tests/integration/states/test_file.py
Expand Up @@ -740,7 +740,7 @@ def test_managed_latin1_diff(self, name):
source='salt://issue-48777/new.html')
ret = ret[next(iter(ret))]
assert ret['result'] is True, ret
diff_lines = ret['changes']['diff'].split('\n')
diff_lines = ret['changes']['diff'].split(os.linesep)
assert '+räksmörgås' in diff_lines, diff_lines

def test_directory(self):
Expand Down Expand Up @@ -1272,8 +1272,15 @@ def test_recurse_issue_40578(self, name):
name=name,
source='salt://соль')
self.assertSaltTrueReturn(ret)
if six.PY2 and salt.utils.platform.is_windows():
# Providing unicode to os.listdir so that we avoid having listdir
# try to decode the filenames using the systemencoding on windows
# python 2.
files = os.listdir(name.decode('utf-8'))
else:
files = salt.utils.data.decode(os.listdir(name), normalize=True)
self.assertEqual(
sorted(salt.utils.data.decode(os.listdir(name), normalize=True)),
sorted(files),
sorted(['foo.txt', 'спам.txt', 'яйца.txt']),
)

Expand Down Expand Up @@ -2206,10 +2213,10 @@ def test_issue_8947_utf8_sls(self, base_dir):
else:
diff = '--- \n+++ \n@@ -1 +1,3 @@\n'
diff += (
'+첫 번째 행\n'
' 한국어 시험\n'
'+마지막 행\n'
)
'+첫 번째 행{0}'
' 한국어 시험{0}'
'+마지막 행{0}'
).format(os.linesep)

ret = {x.split('_|-')[1]: y for x, y in six.iteritems(result)}

Expand Down

0 comments on commit b4a1e1d

Please sign in to comment.