From 3408e0d4636e7818c90616ed03e4b91ff490f25f Mon Sep 17 00:00:00 2001 From: Moss Collum Date: Wed, 1 Oct 2014 11:09:19 -0400 Subject: [PATCH] Add unit test for Service.pull Signed-off-by: Moss Collum --- tests/unit/service_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unit/service_test.py b/tests/unit/service_test.py index 650afa5a6..e9034ccc4 100644 --- a/tests/unit/service_test.py +++ b/tests/unit/service_test.py @@ -128,6 +128,13 @@ class ServiceTest(unittest.TestCase): mock_container_class.from_ps.assert_called_once_with( mock_client, container_dict) + @mock.patch('fig.service.log', autospec=True) + def test_pull_image(self, mock_log): + service = Service('foo', client=self.mock_client, image='someimage:sometag') + service.pull(insecure_registry=True) + self.mock_client.pull.assert_called_once_with('someimage:sometag', insecure_registry=True) + mock_log.info.assert_called_once_with('Pulling foo (someimage:sometag)...') + class ServiceVolumesTest(unittest.TestCase):