diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-10-17 16:38:31 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-10-17 16:45:45 +1300 |
commit | ce98a9219e060b729d4b0d2dc28bf4510649f0fd (patch) | |
tree | c5be5cc8d53de169aadd7c30c4ad41b55b79c783 /test/netlib/test_strutils.py | |
parent | 839813a84c3d63ca44d2721f6cb39b79c489195a (diff) | |
download | mitmproxy-ce98a9219e060b729d4b0d2dc28bf4510649f0fd.tar.gz mitmproxy-ce98a9219e060b729d4b0d2dc28bf4510649f0fd.tar.bz2 mitmproxy-ce98a9219e060b729d4b0d2dc28bf4510649f0fd.zip |
test & examples: zap six
Diffstat (limited to 'test/netlib/test_strutils.py')
-rw-r--r-- | test/netlib/test_strutils.py | 23 |
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(): |