Browse Source

Add unit test for Service.pull

Signed-off-by: Moss Collum <[email protected]>
Moss Collum 11 years ago
parent
commit
3408e0d463
1 changed files with 7 additions and 0 deletions
  1. 7 0
      tests/unit/service_test.py

+ 7 - 0
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):