Added failing test for importing an image via name instead of src

This commit is contained in:
Tom Arnfeld 2013-12-06 23:00:28 +00:00
parent a60c1cd3a8
commit 50337f8628
1 changed files with 21 additions and 0 deletions

View File

@ -740,6 +740,27 @@ class DockerClientTest(unittest.TestCase):
buf.close()
os.remove(buf.name)
def test_import_image_from_image(self):
try:
self.client.import_image(
image=fake_api.FAKE_IMAGE_NAME,
repository=fake_api.FAKE_REPO_NAME,
tag=fake_api.FAKE_TAG_NAME
)
except Exception as e:
self.fail('Command should not raise exception: {0}'.format(e))
fake_request.assert_called_with(
'unix://var/run/docker.sock/v1.6/images/create',
params={
'repo': fake_api.FAKE_REPO_NAME,
'tag': fake_api.FAKE_TAG_NAME,
'fromImage': fake_api.FAKE_IMAGE_NAME
},
data=None,
timeout=docker.client.DEFAULT_TIMEOUT_SECONDS
)
def test_inspect_image(self):
try:
self.client.inspect_image(fake_api.FAKE_IMAGE_NAME)