#NEWLINE# def test_should_handle_multiple_changes_to_files_in_squashed_layers( self ) : #NEWLINE# #INDENT# dockerfile = ( '\n        FROM %s\n        RUN mkdir -p /some/dir/tree\n        RUN touch /some/dir/tree/file1\n        RUN touch /some/dir/tree/file2\n        RUN touch /some/dir/file1\n        RUN touch /some/dir/file2\n        RUN chmod -R 777 /some\n        RUN rm -rf /some/dir/tree\n        ' % TestIntegSquash . BUSYBOX_IMAGE ) #NEWLINE# with self . Image ( dockerfile ) as image : #NEWLINE# #INDENT# with self . SquashedImage ( image , 2 ) as squashed_image : #NEWLINE# #INDENT# squashed_image . assertFileDoesNotExist ( 'some/dir/tree/file1' ) #NEWLINE# squashed_image . assertFileDoesNotExist ( 'some/dir/tree/file2' ) #NEWLINE# squashed_image . assertFileExists ( 'some/dir/file1' ) #NEWLINE# squashed_image . assertFileExists ( 'some/dir/file2' ) #NEWLINE# squashed_image . assertFileExists ( 'some/dir/.wh.tree' ) #NEWLINE# squashed_image . assertFileIsNotHardLink ( 'some/dir/.wh.tree' ) #NEWLINE# with self . Container ( squashed_image ) as container : #NEWLINE# #INDENT# container . assertFileExists ( 'some/dir/file1' ) #NEWLINE# container . assertFileExists ( 'some/dir/file2' ) #NEWLINE# container . assertFileDoesNotExist ( 'some/dir/tree' ) #NEWLINE# container . assertFileDoesNotExist ( 'some/dir/tree/file1' ) #NEWLINE# container . assertFileDoesNotExist ( 'some/dir/tree/file2' ) #NEWLINE# self . assertEqual ( len ( squashed_image . layers ) , ( len ( image . layers ) - 1 ) )