diff options
author | kaiyou <pierre@jaury.eu> | 2017-06-05 17:57:46 +0200 |
---|---|---|
committer | kaiyou <pierre@jaury.eu> | 2017-06-05 18:21:33 +0200 |
commit | 0c1271350db33cb21265309a31da2d1c399b8243 (patch) | |
tree | c5a54c38d1b83576e342e864cafdb0f163e156da | |
parent | 5dd91cd4aaa2e7cd8dde1dd316d53cab25ef9b78 (diff) | |
download | docker-py-0c1271350db33cb21265309a31da2d1c399b8243.tar.gz |
Add a specific unit test for splitting port with IPv6
The test was copied from https://github.com/greybyte/docker-py/commit/ccec87ca2c2aacfcfe3b38c5bc7d59dd73551c51
Signed-off-by: kaiyou <pierre@jaury.eu>
-rw-r--r-- | tests/unit/utils_test.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/unit/utils_test.py b/tests/unit/utils_test.py index 25ed0f9..c25881d 100644 --- a/tests/unit/utils_test.py +++ b/tests/unit/utils_test.py @@ -552,6 +552,12 @@ class PortsTest(unittest.TestCase): self.assertEqual(external_port, [("127.0.0.1", "1000"), ("127.0.0.1", "1001")]) + def test_split_port_with_ipv6_address(self): + internal_port, external_port = split_port( + "2001:abcd:ef00::2:1000:2000") + self.assertEqual(internal_port, ["2000"]) + self.assertEqual(external_port, [("2001:abcd:ef00::2", "1000")]) + def test_split_port_invalid(self): self.assertRaises(ValueError, lambda: split_port("0.0.0.0:1000:2000:tcp")) |