From ce98a9219e060b729d4b0d2dc28bf4510649f0fd Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 17 Oct 2016 16:38:31 +1300 Subject: test & examples: zap six --- test/netlib/test_strutils.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'test/netlib/test_strutils.py') 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(): -- cgit v1.2.3