diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-06-25 21:16:47 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-06-25 21:16:47 +0200 |
commit | e69133f98c513a99c017ad561ea9195280e3f7c5 (patch) | |
tree | bc74a103593173eb170c71734f6844a22b0a6372 /test/test_socks.py | |
parent | 6405595ae8593a52f6b81d7f311044f113476d82 (diff) | |
download | mitmproxy-e69133f98c513a99c017ad561ea9195280e3f7c5.tar.gz mitmproxy-e69133f98c513a99c017ad561ea9195280e3f7c5.tar.bz2 mitmproxy-e69133f98c513a99c017ad561ea9195280e3f7c5.zip |
remove ntop windows workaround
Diffstat (limited to 'test/test_socks.py')
-rw-r--r-- | test/test_socks.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test_socks.py b/test/test_socks.py index 3771df62..4787e309 100644 --- a/test/test_socks.py +++ b/test/test_socks.py @@ -1,5 +1,6 @@ from cStringIO import StringIO import socket +from nose.plugins.skip import SkipTest from netlib import socks, utils import tutils @@ -47,9 +48,13 @@ def test_message(): assert raw.read(2) == "\xBE\xEF" assert msg.addr == ("127.0.0.1", 0xDEAD) + +def test_message_ipv6(): + if not hasattr(socket, "inet_ntop"): + raise SkipTest("Skipped because inet_ntop is not available") # Test ATYP=0x04 (IPV6) ipv6_addr = "2001:0db8:85a3:08d3:1319:8a2e:0370:7344" - raw = StringIO("\x05\x01\x00\x04" + utils.inet_pton(socket.AF_INET6, ipv6_addr) + "\xDE\xAD\xBE\xEF") + raw = StringIO("\x05\x01\x00\x04" + socket.inet_pton(socket.AF_INET6, ipv6_addr) + "\xDE\xAD\xBE\xEF") msg = socks.Message.from_file(raw) assert raw.read(2) == "\xBE\xEF" assert msg.addr.host == ipv6_addr
\ No newline at end of file |