File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ def test_checkIPv4Address(self):
2525 self .assertFalse ( # 8.8.8.8
2626 protocol .checkIPv4Address (b'\x08 \x08 \x08 \x08 ' , token , True ))
2727
28+ def test_checkIPv6Address (self ):
29+ """Check the results of protocol.checkIPv6Address()"""
30+ test_ip = '2001:db8::ff00:42:8329'
31+ self .assertEqual (
32+ 'test' , protocol .checkIPv6Address (
33+ protocol .encodeHost (test_ip ), 'test' ))
34+ self .assertFalse (
35+ protocol .checkIPv6Address (
36+ protocol .encodeHost (test_ip ), 'test' , True ))
37+
2838 def test_check_local (self ):
2939 """Check the logic of TCPConnection.local"""
3040 self .assertTrue (
@@ -35,6 +45,8 @@ def test_check_local(self):
3545 protocol .checkIPAddress (protocol .encodeHost ('10.42.43.1' ), True ))
3646 self .assertTrue (
3747 protocol .checkIPAddress (protocol .encodeHost ('172.31.255.2' ), True ))
48+ self .assertFalse (protocol .checkIPAddress (
49+ protocol .encodeHost ('2001:db8::ff00:42:8329' ), True ))
3850
3951 globalhost = protocol .encodeHost ('8.8.8.8' )
4052 self .assertFalse (protocol .checkIPAddress (globalhost , True ))
You can’t perform that action at this time.
0 commit comments