Merge pull request #1344 from dnephin/fix_pull_with_sha

Support image with ids instead of names
This commit is contained in:
Aanand Prasad 2015-04-29 16:46:34 +01:00
commit 7e0ab0714f
4 changed files with 49 additions and 30 deletions

View file

@ -457,6 +457,11 @@ class ServiceTest(DockerClientTestCase):
],
})
def test_start_with_image_id(self):
# Image id for the current busybox:latest
service = self.create_service('foo', image='8c2e06607696')
self.assertTrue(service.start_or_create_containers())
def test_scale(self):
service = self.create_service('web')
service.scale(1)

View file

@ -22,7 +22,7 @@ class DockerClientTestCase(unittest.TestCase):
self.client.remove_image(i)
def create_service(self, name, **kwargs):
kwargs['image'] = "busybox:latest"
kwargs['image'] = kwargs.pop('image', 'busybox:latest')
if 'command' not in kwargs:
kwargs['command'] = ["/bin/sleep", "300"]