summaryrefslogtreecommitdiff
path: root/test/test_environ.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_environ.py')
-rwxr-xr-xtest/test_environ.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/test_environ.py b/test/test_environ.py
index 3e6e484..4b736af 100755
--- a/test/test_environ.py
+++ b/test/test_environ.py
@@ -556,15 +556,6 @@ class TestResponse(unittest.TestCase):
self.assertEqual(rs.status_code, 404)
self.assertEqual(rs.status_line, '404 Brain not Found')
- # Unicode in status line (thanks RFC7230 :/)
- if bottle.py3k:
- def test(): rs.status = '400 Non-ASCÜ'
- self.assertRaises(ValueError, test)
- self.assertEqual(rs.status, rs.status_line)
- self.assertEqual(rs.status_code, 400)
- wire = rs._wsgi_status_line().encode('latin1')
- self.assertEqual(rs.status, wire.decode('utf8'))
-
def test(): rs.status = '5 Illegal Code'
self.assertRaises(ValueError, test)
self.assertEqual(rs.status, rs.status_line) # last value
@@ -589,6 +580,14 @@ class TestResponse(unittest.TestCase):
self.assertEqual(rs.status_code, 404) # last value
self.assertEqual(rs.status_line, '404 Brain not Found') # last value
+ # Unicode in status line (thanks RFC7230 :/)
+ if bottle.py3k:
+ rs.status = '400 Non-ASÎÎ'
+ self.assertEqual(rs.status, rs.status_line)
+ self.assertEqual(rs.status_code, 400)
+ wire = rs._wsgi_status_line().encode('latin1')
+ self.assertEqual(rs.status, wire.decode('utf8'))
+
def test_content_type(self):
rs = BaseResponse()
rs.content_type = 'test/some'