Commit 99050aac authored by Brian May's avatar Brian May

Fix for Python3.5.

parent 021e6f57
from mock import patch, call from mock import patch, call
import sys
import io import io
import socket import socket
...@@ -162,4 +163,9 @@ def test_family_ip_tuple(): ...@@ -162,4 +163,9 @@ def test_family_ip_tuple():
def test_family_to_string(): def test_family_to_string():
assert sshuttle.helpers.family_to_string(socket.AF_INET) == "AF_INET" assert sshuttle.helpers.family_to_string(socket.AF_INET) == "AF_INET"
assert sshuttle.helpers.family_to_string(socket.AF_INET6) == "AF_INET6" assert sshuttle.helpers.family_to_string(socket.AF_INET6) == "AF_INET6"
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == "1" if sys.version_info < (3, 0):
expected = "1"
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == "1"
else:
expected = 'AddressFamily.AF_UNIX'
assert sshuttle.helpers.family_to_string(socket.AF_UNIX) == expected
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment