diff options
| author | Tom Arnfeld <tarnfeld@me.com> | 2013-12-06 23:00:28 +0000 |
|---|---|---|
| committer | Tom Arnfeld <tarnfeld@me.com> | 2013-12-06 23:00:28 +0000 |
| commit | 50337f8628dee2f8abe92ec97cbff39f25660b3e (patch) | |
| tree | 8d77ada6c46cea2836a04b025ead2f1b63a1df16 /tests/test.py | |
| parent | a60c1cd3a8cfe6bfb11f22a749461de0fd2835ee (diff) | |
| download | docker-py-50337f8628dee2f8abe92ec97cbff39f25660b3e.tar.gz | |
Added failing test for importing an image via name instead of src
Diffstat (limited to 'tests/test.py')
| -rw-r--r-- | tests/test.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test.py b/tests/test.py index e058d28..a476792 100644 --- a/tests/test.py +++ b/tests/test.py @@ -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) |
