summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2016-03-17 16:18:37 -0700
committerJoffrey F <joffrey@docker.com>2016-03-17 16:18:37 -0700
commit3168149cbf20b51ac59ea2552a4e9dd7425ed784 (patch)
treec8d75584d7cf56f297f22cb8cd85cc36dbfb5dcb /tests
parent41acd70fd46f0d50516c78843ca739421cb450e4 (diff)
downloaddocker-py-tcp-to-https-parsehost.tar.gz
If tcp host is provided while TLS is enabled, convert to httpstcp-to-https-parsehost
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/utils_test.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/unit/utils_test.py b/tests/unit/utils_test.py
index 65b7cf8..c744604 100644
--- a/tests/unit/utils_test.py
+++ b/tests/unit/utils_test.py
@@ -412,7 +412,12 @@ class ParseHostTest(base.BaseTestCase):
def test_parse_host_tls(self):
host_value = 'myhost.docker.net:3348'
expected_result = 'https://myhost.docker.net:3348'
- self.assertEqual(parse_host(host_value, None, True), expected_result)
+ assert parse_host(host_value, tls=True) == expected_result
+
+ def test_parse_host_tls_tcp_proto(self):
+ host_value = 'tcp://myhost.docker.net:3348'
+ expected_result = 'https://myhost.docker.net:3348'
+ assert parse_host(host_value, tls=True) == expected_result
class ParseRepositoryTagTest(base.BaseTestCase):