summaryrefslogtreecommitdiff
path: root/tests/unit/utils_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/utils_test.py')
-rw-r--r--tests/unit/utils_test.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/unit/utils_test.py b/tests/unit/utils_test.py
index d436de2..1ea13a9 100644
--- a/tests/unit/utils_test.py
+++ b/tests/unit/utils_test.py
@@ -18,8 +18,9 @@ from docker.utils import (
parse_repository_tag, parse_host, convert_filters, kwargs_from_env,
create_host_config, Ulimit, LogConfig, parse_bytes, parse_env_file,
exclude_paths, convert_volume_binds, decode_json_header, tar,
- split_command, create_ipam_config, create_ipam_pool
+ split_command, create_ipam_config, create_ipam_pool,
)
+from docker.utils.utils import create_endpoint_config
from docker.utils.ports import build_port_bindings, split_port
from .. import base
@@ -69,6 +70,13 @@ class HostConfigTest(base.BaseTestCase):
InvalidVersion, lambda: create_host_config(version='1.18.3',
oom_kill_disable=True))
+ def test_create_endpoint_config_with_aliases(self):
+ config = create_endpoint_config(version='1.22', aliases=['foo', 'bar'])
+ assert config == {'Aliases': ['foo', 'bar']}
+
+ with pytest.raises(InvalidVersion):
+ create_endpoint_config(version='1.21', aliases=['foo', 'bar'])
+
class UlimitTest(base.BaseTestCase):
def test_create_host_config_dict_ulimit(self):