mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Better blockfix replace
This commit is contained in:
parent
dd4fcd3445
commit
1bf0b18224
1 changed files with 8 additions and 8 deletions
|
@ -5,7 +5,7 @@ Tests for the file state
|
|||
'''
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from __future__ import absolute_import
|
||||
import errno
|
||||
import glob
|
||||
import logging
|
||||
|
@ -2650,12 +2650,12 @@ class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
content = os.linesep.join([
|
||||
'Line 1 of block',
|
||||
'Line 2 of block',
|
||||
''])
|
||||
'']).decode('utf-8')
|
||||
without_block = os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
'# comment here',
|
||||
''])
|
||||
'']).decode('utf-8')
|
||||
with_non_matching_block = os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
|
@ -2663,14 +2663,14 @@ class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
'No match here',
|
||||
'# end',
|
||||
'# comment here',
|
||||
''])
|
||||
'']).decode('utf-8')
|
||||
with_non_matching_block_and_marker_end_not_after_newline = os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
'# start',
|
||||
'No match here# end',
|
||||
'# comment here',
|
||||
''])
|
||||
'']).decode('utf-8')
|
||||
with_matching_block = os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
|
@ -2679,7 +2679,7 @@ class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
'Line 2 of block',
|
||||
'# end',
|
||||
'# comment here',
|
||||
''])
|
||||
'']).decode('utf-8')
|
||||
with_matching_block_and_extra_newline = os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
|
@ -2689,7 +2689,7 @@ class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
'',
|
||||
'# end',
|
||||
'# comment here',
|
||||
''])
|
||||
'']).decode('utf-8')
|
||||
with_matching_block_and_marker_end_not_after_newline = os.linesep.join([
|
||||
'Hello world!',
|
||||
'',
|
||||
|
@ -2697,7 +2697,7 @@ class BlockreplaceTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
'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