summaryrefslogtreecommitdiffstats
path: root/python-dockering/tests/test_config_building.py
diff options
context:
space:
mode:
authorAndrew Gauld <agauld@att.com>2019-08-13 13:32:27 +0000
committerAndrew Gauld <agauld@att.com>2019-08-13 15:06:26 +0000
commitebd03eb6490b8e60fe0f090aac921efb7778f1f5 (patch)
treed2b752e49028ff637641a320f1156d2d119fb71f /python-dockering/tests/test_config_building.py
parent5013228b2a3deb99d56c8aa433e746abf9b1f458 (diff)
Update obsolete docker python version5.0.2-ONAP5.0.1-ONAPelalto
Issue-ID: DCAEGEN2-1725 Signed-off-by: Andrew Gauld <agauld@att.com> Change-Id: I2bbb52591c6c1774303d8d2b6bc3480fb28d9fac Signed-off-by: Andrew Gauld <agauld@att.com>
Diffstat (limited to 'python-dockering/tests/test_config_building.py')
-rw-r--r--python-dockering/tests/test_config_building.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/python-dockering/tests/test_config_building.py b/python-dockering/tests/test_config_building.py
index 16ecb58..c1df84a 100644
--- a/python-dockering/tests/test_config_building.py
+++ b/python-dockering/tests/test_config_building.py
@@ -26,20 +26,20 @@ from dockering.exceptions import DockerConstructionError
# The docker-py library sneakily expects version to "know" that there is an
# actual Docker API that you can connect with.
-DOCKER_API_VERSION = "1.24"
-create_host_config = partial(docker.utils.utils.create_host_config,
+DOCKER_API_VERSION = "auto"
+HostConfig = partial(docker.types.HostConfig,
version=DOCKER_API_VERSION)
def test_add_host_config_params_volumes():
hcp = doc.add_host_config_params_volumes()
- hc = create_host_config(**hcp)
+ hc = HostConfig(**hcp)
expected = { 'NetworkMode': 'default' }
assert expected == hc
volumes = [{"host": {"path": "some-path-host"},
"container": {"bind": "some-path-container", "mode": "ro"}}]
hcp = doc.add_host_config_params_volumes(volumes=volumes)
- hc = create_host_config(**hcp)
+ hc = HostConfig(**hcp)
expected = {'Binds': ['some-path-host:some-path-container:ro'], 'NetworkMode': 'default'}
assert expected == hc
@@ -47,13 +47,13 @@ def test_add_host_config_params_volumes():
def test_add_host_config_params_ports():
ports = [ "22:22", "80:80" ]
hcp = doc.add_host_config_params_ports(ports=ports)
- hc = create_host_config(**hcp)
+ hc = HostConfig(**hcp)
expected = {'PortBindings': {'22/tcp': [{'HostPort': '22', 'HostIp': ''}],
'80/tcp': [{'HostPort': '80', 'HostIp': ''}]}, 'NetworkMode': 'default'}
assert expected == hc
hcp = doc.add_host_config_params_ports()
- hc = create_host_config(**hcp)
+ hc = HostConfig(**hcp)
expected = {'NetworkMode': 'default', 'PublishAllPorts': True}
assert expected == hc
@@ -61,7 +61,7 @@ def test_add_host_config_params_ports():
def test_add_host_config_params_dns():
docker_host = "192.168.1.1"
hcp = doc.add_host_config_params_dns(docker_host)
- hc = create_host_config(**hcp)
+ hc = HostConfig(**hcp)
expected = {'NetworkMode': 'default', 'DnsSearch': ['service.consul'],
'Dns': ['192.168.1.1'], 'ExtraHosts': ['consul:192.168.1.1']}
assert expected == hc