[virt-tools-list] [virt-bootstrap] [PATCH 1/5] tests: docker_source: Mock out is_installed()

Radostin Stoyanov rstoyanov1 at gmail.com
Tue Apr 10 16:38:01 UTC 2018


Commit b38f588 (source-docker: Show error if skopeo not installed)
introduced a check used by Docker-souce to verify that skopeo is
installed. However, the unit test cases in TestDockerSource do not
aim to ensure that skopeo is installed and therefore this check is
redundant.

Signed-off-by: Radostin Stoyanov <rstoyanov1 at gmail.com>
---
 tests/docker_source.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/docker_source.py b/tests/docker_source.py
index a921bb8..7f3c783 100644
--- a/tests/docker_source.py
+++ b/tests/docker_source.py
@@ -317,10 +317,12 @@ class TestDockerSource(unittest.TestCase):
         """
         with mock.patch.multiple('virtBootstrap.utils',
                                  get_image_details=mock.DEFAULT,
+                                 is_installed=mock.DEFAULT,
                                  get_image_dir=mock.DEFAULT) as m_utils:
 
             m_utils['get_image_details'].return_value = manifest
             m_utils['get_image_dir'].return_value = '/images_path'
+            m_utils['is_installed'].return_value = True
 
             patch_method = 'virtBootstrap.sources.DockerSource.gen_valid_uri'
             with mock.patch(patch_method) as m_uri:
-- 
2.14.3




More information about the virt-tools-list mailing list