diff options
author | Aldo Cortesi <aldo@corte.si> | 2016-10-17 17:03:02 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-17 17:03:02 +1300 |
commit | ae3ff8ee1edc646e7a640219df1a312c27f7c339 (patch) | |
tree | 490697113ceaf12cc704c418357139e60a0190f3 /test/netlib/test_strutils.py | |
parent | 3fbce7e981cab5d20b3ef17a50f14b34e8c60fa3 (diff) | |
parent | ce98a9219e060b729d4b0d2dc28bf4510649f0fd (diff) | |
download | mitmproxy-ae3ff8ee1edc646e7a640219df1a312c27f7c339.tar.gz mitmproxy-ae3ff8ee1edc646e7a640219df1a312c27f7c339.tar.bz2 mitmproxy-ae3ff8ee1edc646e7a640219df1a312c27f7c339.zip |
Merge pull request #1615 from cortesi/python3a
exterminate 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(): |