From b1a257bacc1c4ac2c1401ed02c51d9c6c03685d2 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Mon, 12 Nov 2018 23:16:09 -0600 Subject: get rid of type aliases --- tests/test_httpexceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_httpexceptions.py') diff --git a/tests/test_httpexceptions.py b/tests/test_httpexceptions.py index 4c13e096d..195496e2e 100644 --- a/tests/test_httpexceptions.py +++ b/tests/test_httpexceptions.py @@ -1,6 +1,6 @@ import unittest -from pyramid.compat import bytes_, string_types, text_ +from pyramid.compat import bytes_, text_ class Test_exception_response(unittest.TestCase): @@ -406,7 +406,7 @@ class TestHTTPException(unittest.TestCase): def test_allow_detail_non_str(self): exc = self._makeOne(detail={'error': 'This is a test'}) - self.assertIsInstance(exc.__str__(), string_types) + self.assertIsInstance(exc.__str__(), str) class TestRenderAllExceptionsWithoutArguments(unittest.TestCase): -- cgit v1.2.3 From 78dcc6dff88829831ead187804ac9233eafab52e Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 14 Nov 2018 21:26:39 -0600 Subject: remove several places supporting bytes for py2 --- tests/test_httpexceptions.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/test_httpexceptions.py') diff --git a/tests/test_httpexceptions.py b/tests/test_httpexceptions.py index 195496e2e..48c4a22f3 100644 --- a/tests/test_httpexceptions.py +++ b/tests/test_httpexceptions.py @@ -67,6 +67,12 @@ class Test__no_escape(unittest.TestCase): def test_not_basestring(self): self.assertEqual(self._callFUT(42), '42') + def test_bytes(self): + self.assertEqual( + self._callFUT(b'/La Pe\xc3\xb1a/{x}'), + b'/La Pe\xc3\xb1a/{x}'.decode('utf-8'), + ) + def test_unicode(self): class DummyUnicodeObject(object): def __unicode__(self): -- cgit v1.2.3 From 2f8ede09e52162e475aececf587b21e96a2b1a79 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 14 Nov 2018 22:15:57 -0600 Subject: move text_, bytes_ and ascii_ to pyramid.util and remove native_ --- tests/test_httpexceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_httpexceptions.py') diff --git a/tests/test_httpexceptions.py b/tests/test_httpexceptions.py index 48c4a22f3..5decfc39c 100644 --- a/tests/test_httpexceptions.py +++ b/tests/test_httpexceptions.py @@ -1,6 +1,6 @@ import unittest -from pyramid.compat import bytes_, text_ +from pyramid.util import bytes_, text_ class Test_exception_response(unittest.TestCase): -- cgit v1.2.3