summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian May <brian@linuxpenguins.xyz>2015-11-17 13:12:41 +1100
committerBrian May <brian@linuxpenguins.xyz>2015-11-17 13:14:28 +1100
commit99050aacb356a50f00f73635a1664284bd95802d (patch)
tree9071a43c2335fd935c6bbb86139ecb99b0da678e
parent021e6f57af228f9b53d049fee9bd1aca574b12c4 (diff)
Fix for Python3.5.
-rw-r--r--sshuttle/tests/test_helpers.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sshuttle/tests/test_helpers.py b/sshuttle/tests/test_helpers.py
index aa765ce..3017b19 100644
--- a/sshuttle/tests/test_helpers.py
+++ b/sshuttle/tests/test_helpers.py
@@ -1,4 +1,5 @@
from mock import patch, call
+import sys
import io
import socket
@@ -162,4 +163,9 @@ def test_family_ip_tuple():
def test_family_to_string():
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_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