diff options
author | Joffrey F <joffrey@docker.com> | 2018-02-13 15:17:03 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2018-02-14 16:07:19 -0800 |
commit | 581ccc9f7e8e189248054268c98561ca775bd3d7 (patch) | |
tree | 682c25e7e624ecf6933a918b869f990950798d2f /tests | |
parent | 9e75609aec497361068bd0f57d5cc24065621106 (diff) | |
download | docker-py-1352-data_stream_control.tar.gz |
Add chunk_size parameter to data downloading methods (export, get_archive, save)1352-data_stream_control
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/models_containers_test.py | 9 | ||||
-rw-r--r-- | tests/unit/models_images_test.py | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/unit/models_containers_test.py b/tests/unit/models_containers_test.py index f79f5d5..2b0b499 100644 --- a/tests/unit/models_containers_test.py +++ b/tests/unit/models_containers_test.py @@ -1,4 +1,5 @@ import docker +from docker.constants import DEFAULT_DATA_CHUNK_SIZE from docker.models.containers import Container, _create_container_args from docker.models.images import Image import unittest @@ -422,13 +423,17 @@ class ContainerTest(unittest.TestCase): client = make_fake_client() container = client.containers.get(FAKE_CONTAINER_ID) container.export() - client.api.export.assert_called_with(FAKE_CONTAINER_ID) + client.api.export.assert_called_with( + FAKE_CONTAINER_ID, DEFAULT_DATA_CHUNK_SIZE + ) def test_get_archive(self): client = make_fake_client() container = client.containers.get(FAKE_CONTAINER_ID) container.get_archive('foo') - client.api.get_archive.assert_called_with(FAKE_CONTAINER_ID, 'foo') + client.api.get_archive.assert_called_with( + FAKE_CONTAINER_ID, 'foo', DEFAULT_DATA_CHUNK_SIZE + ) def test_image(self): client = make_fake_client() diff --git a/tests/unit/models_images_test.py b/tests/unit/models_images_test.py index dacd72b..6783279 100644 --- a/tests/unit/models_images_test.py +++ b/tests/unit/models_images_test.py @@ -1,3 +1,4 @@ +from docker.constants import DEFAULT_DATA_CHUNK_SIZE from docker.models.images import Image import unittest @@ -116,7 +117,9 @@ class ImageTest(unittest.TestCase): client = make_fake_client() image = client.images.get(FAKE_IMAGE_ID) image.save() - client.api.get_image.assert_called_with(FAKE_IMAGE_ID) + client.api.get_image.assert_called_with( + FAKE_IMAGE_ID, DEFAULT_DATA_CHUNK_SIZE + ) def test_tag(self): client = make_fake_client() |