Add unit test for Service.pull

Signed-off-by: Moss Collum <mcollum@luminoso.com>
This commit is contained in:
Moss Collum 2014-10-01 11:09:19 -04:00
parent c270e9d622
commit 3408e0d463
1 changed files with 7 additions and 0 deletions

View File

@ -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):