aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib/test_strutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/netlib/test_strutils.py')
-rw-r--r--test/netlib/test_strutils.py23
1 files changed, 6 insertions, 17 deletions
diff --git a/test/netlib/test_strutils.py b/test/netlib/test_strutils.py
index 0f58cac5..36f709da 100644
--- a/test/netlib/test_strutils.py
+++ b/test/netlib/test_strutils.py
@@ -1,5 +1,3 @@
-import six
-
from netlib import strutils, tutils
@@ -15,12 +13,8 @@ def test_always_bytes():
def test_native():
with tutils.raises(TypeError):
strutils.native(42)
- if six.PY2:
- assert strutils.native(u"foo") == b"foo"
- assert strutils.native(b"foo") == b"foo"
- else:
- assert strutils.native(u"foo") == u"foo"
- assert strutils.native(b"foo") == u"foo"
+ assert strutils.native(u"foo") == u"foo"
+ assert strutils.native(b"foo") == u"foo"
def test_escape_control_characters():
@@ -40,9 +34,8 @@ def test_escape_control_characters():
u'=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~.'
)
- if not six.PY2:
- with tutils.raises(ValueError):
- strutils.escape_control_characters(b"foo")
+ with tutils.raises(ValueError):
+ strutils.escape_control_characters(b"foo")
def test_bytes_to_escaped_str():
@@ -76,12 +69,8 @@ def test_escaped_str_to_bytes():
assert strutils.escaped_str_to_bytes(u"&!?=\\\\)") == br"&!?=\)"
assert strutils.escaped_str_to_bytes(u"\u00fc") == b'\xc3\xbc'
- if six.PY2:
- with tutils.raises(ValueError):
- strutils.escaped_str_to_bytes(42)
- else:
- with tutils.raises(ValueError):
- strutils.escaped_str_to_bytes(b"very byte")
+ with tutils.raises(ValueError):
+ strutils.escaped_str_to_bytes(b"very byte")
def test_is_mostly_bin():