mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use six to make sure content is unicode
This commit is contained in:
parent
1bf0b18224
commit
72c37271a5
1 changed files with 14 additions and 14 deletions
|
@ -2647,31 +2647,31 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
|
||||
marker_start = '# start'
|
||||
marker_end = '# end'
|
||||
content = os.linesep.join([
|
||||
content = six.text_type(os.linesep.join([
|
||||
'Line 1 of block',
|
||||
'Line 2 of block',
|
||||
'']).decode('utf-8')
|
||||
without_block = os.linesep.join([
|
||||
'']))
|
||||
without_block = six.text_type(os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
'# comment here',
|
||||
'']).decode('utf-8')
|
||||
with_non_matching_block = os.linesep.join([
|
||||
'']))
|
||||
with_non_matching_block = six.text_type(os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
'# start',
|
||||
'No match here',
|
||||
'# end',
|
||||
'# comment here',
|
||||
'']).decode('utf-8')
|
||||
with_non_matching_block_and_marker_end_not_after_newline = os.linesep.join([
|
||||
'']))
|
||||
with_non_matching_block_and_marker_end_not_after_newline = six.text_type(os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
'# start',
|
||||
'No match here# end',
|
||||
'# comment here',
|
||||
'']).decode('utf-8')
|
||||
with_matching_block = os.linesep.join([
|
||||
'']))
|
||||
with_matching_block = six.text_type(os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
'# start',
|
||||
|
@ -2679,8 +2679,8 @@ class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
'Line 2 of block',
|
||||
'# end',
|
||||
'# comment here',
|
||||
'']).decode('utf-8')
|
||||
with_matching_block_and_extra_newline = os.linesep.join([
|
||||
'']))
|
||||
with_matching_block_and_extra_newline = six.text_type(os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
'# start',
|
||||
|
@ -2689,15 +2689,15 @@ class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
'',
|
||||
'# end',
|
||||
'# comment here',
|
||||
'']).decode('utf-8')
|
||||
with_matching_block_and_marker_end_not_after_newline = os.linesep.join([
|
||||
'']))
|
||||
with_matching_block_and_marker_end_not_after_newline = six.text_type(os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
'# start',
|
||||
'Line 1 of block',
|
||||
'Line 2 of block# end',
|
||||
'# comment here',
|
||||
'']).decode('utf-8')
|
||||
'']))
|
||||
content_explicit_posix_newlines = ('Line 1 of block\n'
|
||||
'Line 2 of block\n')
|
||||
content_explicit_windows_newlines = ('Line 1 of block\r\n'
|
||||
|
|
Loading…
Add table
Reference in a new issue