summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSeth Michael Larson <sethmichaellarson@gmail.com>2019-04-25 14:56:17 -0500
committerGitHub <noreply@github.com>2019-04-25 14:56:17 -0500
commita0d2bfd6098fe996fca74b80cbe473236187157c (patch)
treeff02b1b6146ca371c27c0bcb3e52679b675594ef /test
parentdae790cc1f41a9a8014ccfe0dad06b94794c46be (diff)
downloadurllib3-a0d2bfd6098fe996fca74b80cbe473236187157c.tar.gz
is_ipaddress shouldn't detect IPvFuture addresses (#1583)
Diffstat (limited to 'test')
-rw-r--r--test/test_ssl.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/test_ssl.py b/test/test_ssl.py
index 6a46b4f3..8cc15f2a 100644
--- a/test/test_ssl.py
+++ b/test/test_ssl.py
@@ -5,11 +5,21 @@ from urllib3.exceptions import SNIMissingWarning
@pytest.mark.parametrize('addr', [
+ # IPv6
'::1',
'::',
+ 'FE80::8939:7684:D84b:a5A4%251',
+
+ # IPv4
'127.0.0.1',
'8.8.8.8',
- b'127.0.0.1'
+ b'127.0.0.1',
+
+ # IPv6 w/ Zone IDs
+ 'FE80::8939:7684:D84b:a5A4%251',
+ b'FE80::8939:7684:D84b:a5A4%251',
+ 'FE80::8939:7684:D84b:a5A4%19',
+ b'FE80::8939:7684:D84b:a5A4%19'
])
def test_is_ipaddress_true(addr):
assert ssl_.is_ipaddress(addr)
@@ -17,7 +27,9 @@ def test_is_ipaddress_true(addr):
@pytest.mark.parametrize('addr', [
'www.python.org',
- b'www.python.org'
+ b'www.python.org',
+ 'v2.sg.media-imdb.com',
+ b'v2.sg.media-imdb.com'
])
def test_is_ipaddress_false(addr):
assert not ssl_.is_ipaddress(addr)