#NEWLINE# def test_replace_partial_marked_lines( self ) : #NEWLINE# #INDENT# filemod . blockreplace ( self . tfile . name , '// START BLOCK' , '// END BLOCK' , 'new content 1' , backup = False ) #NEWLINE# with salt . utils . fopen ( self . tfile . name , 'r' ) as fp : #NEWLINE# #INDENT# filecontent = fp . read ( ) #NEWLINE# #UNINDENT# self . assertIn ( 'new content 1' , filecontent ) #NEWLINE# self . assertNotIn ( 'to be removed' , filecontent ) #NEWLINE# self . assertIn ( 'first part of start line' , filecontent ) #NEWLINE# self . assertIn ( 'first part of end line' , filecontent ) #NEWLINE# self . assertIn ( 'part of start line not removed' , filecontent ) #NEWLINE# self . assertIn ( 'part of end line not removed' , filecontent )