def test_only_files_from_squashed_image_should_be_in_squashed_layer(self):
        dockerfile = '''
        FROM %s
        RUN touch /somefile_layer1
        RUN touch /somefile_layer2
        RUN touch /somefile_layer3
        ''' % TestIntegSquash.BUSYBOX_IMAGE

        with self.Image(dockerfile) as image:
            with self.SquashedImage(image, 2) as squashed_image:
                squashed_image.assertFileDoesNotExist('.wh.somefile_layer2')
                squashed_image.assertFileDoesNotExist('.wh.somefile_layer3')
                # This file should not be in the squashed layer
                squashed_image.assertFileDoesNotExist('somefile_layer1')
                # Nor a marker files for it
                squashed_image.assertFileDoesNotExist('.wh.somefile_layer1')
                squashed_image.assertFileExists('somefile_layer2')
                squashed_image.assertFileExists('somefile_layer3')

                with self.Container(squashed_image) as container:
                    # This file should be in the container
                    container.assertFileExists('somefile_layer1')
                    container.assertFileExists('somefile_layer2')
                    container.assertFileExists('somefile_layer3')

                    # We should have two layers less in the image
                    self.assertEqual(
                        len(squashed_image.layers), len(image.layers) - 1)
We squash all layers in RUN, all files should be in the resulting squashed layer.
dataset/ETHPy150Open goldmann/docker-squash/tests/test_integ_squash.py/TestIntegSquash.test_only_files_from_squashed_image_should_be_in_squashed_layer