diff options
author | Joffrey F <joffrey@docker.com> | 2018-01-31 14:32:32 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2018-01-31 14:42:01 -0800 |
commit | df8422d0791d7d03cd3e1efe37a9c72f242f1f78 (patch) | |
tree | db555dc7a8c4f16f33c6ac4a7ddd1c072dbe6eef /tests/unit/api_container_test.py | |
parent | b180b8770a265e33099bd6da76c3e556a1028491 (diff) | |
download | docker-py-cleanup_deprecated.tar.gz |
Refuse API version < 1.21 ; Remove associated code pathscleanup_deprecated
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/unit/api_container_test.py')
-rw-r--r-- | tests/unit/api_container_test.py | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/tests/unit/api_container_test.py b/tests/unit/api_container_test.py index 3cb718a..c33f129 100644 --- a/tests/unit/api_container_test.py +++ b/tests/unit/api_container_test.py @@ -219,24 +219,6 @@ class CreateContainerTest(BaseAPIClientTest): ''') assert args[1]['headers'] == {'Content-Type': 'application/json'} - def test_create_container_with_cpu_shares(self): - with pytest.deprecated_call(): - self.client.create_container('busybox', 'ls', cpu_shares=5) - - args = fake_request.call_args - assert args[0][1] == url_prefix + 'containers/create' - assert json.loads(args[1]['data']) == json.loads(''' - {"Tty": false, "Image": "busybox", - "Cmd": ["ls"], "AttachStdin": false, - "AttachStderr": true, - "AttachStdout": true, "OpenStdin": false, - "StdinOnce": false, - "NetworkDisabled": false, - "CpuShares": 5} - ''') - assert args[1]['headers'] == {'Content-Type': 'application/json'} - - @requires_api_version('1.18') def test_create_container_with_host_config_cpu_shares(self): self.client.create_container( 'busybox', 'ls', host_config=self.client.create_host_config( @@ -261,25 +243,6 @@ class CreateContainerTest(BaseAPIClientTest): ''') assert args[1]['headers'] == {'Content-Type': 'application/json'} - def test_create_container_with_cpuset(self): - with pytest.deprecated_call(): - self.client.create_container('busybox', 'ls', cpuset='0,1') - - args = fake_request.call_args - assert args[0][1] == url_prefix + 'containers/create' - assert json.loads(args[1]['data']) == json.loads(''' - {"Tty": false, "Image": "busybox", - "Cmd": ["ls"], "AttachStdin": false, - "AttachStderr": true, - "AttachStdout": true, "OpenStdin": false, - "StdinOnce": false, - "NetworkDisabled": false, - "Cpuset": "0,1", - "CpusetCpus": "0,1"} - ''') - assert args[1]['headers'] == {'Content-Type': 'application/json'} - - @requires_api_version('1.18') def test_create_container_with_host_config_cpuset(self): self.client.create_container( 'busybox', 'ls', host_config=self.client.create_host_config( @@ -304,7 +267,6 @@ class CreateContainerTest(BaseAPIClientTest): ''') assert args[1]['headers'] == {'Content-Type': 'application/json'} - @requires_api_version('1.19') def test_create_container_with_host_config_cpuset_mems(self): self.client.create_container( 'busybox', 'ls', host_config=self.client.create_host_config( @@ -374,28 +336,6 @@ class CreateContainerTest(BaseAPIClientTest): ''') assert args[1]['headers'] == {'Content-Type': 'application/json'} - def test_create_container_with_volumes_from(self): - vol_names = ['foo', 'bar'] - try: - self.client.create_container('busybox', 'true', - volumes_from=vol_names) - except docker.errors.DockerException: - assert docker.utils.compare_version( - '1.10', self.client._version - ) >= 0 - return - - args = fake_request.call_args - assert args[0][1] == url_prefix + 'containers/create' - assert json.loads(args[1]['data'])['VolumesFrom'] == ','.join( - vol_names - ) - assert args[1]['headers'] == {'Content-Type': 'application/json'} - - def test_create_container_empty_volumes_from(self): - with pytest.raises(docker.errors.InvalidVersion): - self.client.create_container('busybox', 'true', volumes_from=[]) - def test_create_named_container(self): self.client.create_container('busybox', 'true', name='marisa-kirisame') |