diff options
| author | Nicolas De Loof <nicolas.deloof@gmail.com> | 2021-03-04 11:37:07 +0100 |
|---|---|---|
| committer | Nicolas De loof <nicolas.deloof@gmail.com> | 2021-03-10 11:25:18 +0100 |
| commit | 563124163a5d092e954846121150d896ddca0836 (patch) | |
| tree | 5f09690013af23904b1c9eff474d279790f098ad /tests/unit | |
| parent | 55f405e04a91ddbbc26aa738bd3cb41bd28f8dbd (diff) | |
| download | docker-py-563124163a5d092e954846121150d896ddca0836.tar.gz | |
relax PORT_SPEC regex so it accept and ignore square brackets
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Diffstat (limited to 'tests/unit')
| -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 a53151c..0d6ff22 100644 --- a/tests/unit/utils_test.py +++ b/tests/unit/utils_test.py @@ -541,6 +541,12 @@ class PortsTest(unittest.TestCase): assert internal_port == ["2000"] assert external_port == [("2001:abcd:ef00::2", "1000")] + def test_split_port_with_ipv6_square_brackets_address(self): + internal_port, external_port = split_port( + "[2001:abcd:ef00::2]:1000:2000") + assert internal_port == ["2000"] + assert external_port == [("2001:abcd:ef00::2", "1000")] + def test_split_port_invalid(self): with pytest.raises(ValueError): split_port("0.0.0.0:1000:2000:tcp") |
