From 376dd96934de59d72db5fde376533bcba2bdc670 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Sat, 26 Aug 2017 21:41:55 +0100 Subject: DockerSource: Split checksum and layers The current implementation store in one list: - checksum - checksum type - file path - file size However, the information about checksum and checksum type is only used to verify the content of tarball before it is being extracted. Splitting these into separate lists would allow us to reuse the function untar_layers() with FileSource. --- tests/docker_source.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/docker_source.py') diff --git a/tests/docker_source.py b/tests/docker_source.py index 5f9e6fe..9dc25d9 100644 --- a/tests/docker_source.py +++ b/tests/docker_source.py @@ -333,9 +333,9 @@ class TestDockerSource(unittest.TestCase): } expected_result = [ - ['sha256', 'a7050fc1', '/images_path/a7050fc1.tar', None], - ['sha256', 'c6ff40b6', '/images_path/c6ff40b6.tar', None], - ['sha256', '75c416ea', '/images_path/75c416ea.tar', None] + ['/images_path/a7050fc1.tar', None], + ['/images_path/c6ff40b6.tar', None], + ['/images_path/75c416ea.tar', None] ] with mock.patch('os.path.getsize') as m_getsize: @@ -364,9 +364,9 @@ class TestDockerSource(unittest.TestCase): } expected_result = [ - ['sha256', '75c416ea', '/images_path/75c416ea.tar', 47103294], - ['sha256', 'c6ff40b6', '/images_path/c6ff40b6.tar', 814], - ['sha256', 'a7050fc1', '/images_path/a7050fc1.tar', 513] + ['/images_path/75c416ea.tar', 47103294], + ['/images_path/c6ff40b6.tar', 814], + ['/images_path/a7050fc1.tar', 513] ] src_instance = self._mock_retrieve_layers_info(manifest, kwargs)[0] -- cgit