aboutsummaryrefslogtreecommitdiff
path: root/kolla/tests
diff options
context:
space:
mode:
Diffstat (limited to 'kolla/tests')
-rw-r--r--kolla/tests/test_build.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/kolla/tests/test_build.py b/kolla/tests/test_build.py
index b7aa0c29e..be2dce7e9 100644
--- a/kolla/tests/test_build.py
+++ b/kolla/tests/test_build.py
@@ -57,15 +57,26 @@ class TasksTest(base.TestCase):
self.imageChild.parent = self.image
self.imageChild.path = self.useFixture(fixtures.TempDir()).path
+ @mock.patch('docker.version', '2.7.0')
@mock.patch.dict(os.environ, clear=True)
@mock.patch('docker.APIClient')
- def test_push_image(self, mock_client):
+ def test_push_image_before_v3_0_0(self, mock_client):
self.dc = mock_client
pusher = build.PushTask(self.conf, self.image)
pusher.run()
mock_client().push.assert_called_once_with(
self.image.canonical_name, stream=True, insecure_registry=True)
+ @mock.patch('docker.version', '3.0.0')
+ @mock.patch.dict(os.environ, clear=True)
+ @mock.patch('docker.APIClient')
+ def test_push_image(self, mock_client):
+ self.dc = mock_client
+ pusher = build.PushTask(self.conf, self.image)
+ pusher.run()
+ mock_client().push.assert_called_once_with(
+ self.image.canonical_name, stream=True)
+
@mock.patch.dict(os.environ, clear=True)
@mock.patch('docker.APIClient')
def test_build_image(self, mock_client):