Commit 7dbdf671 by Will Daly

Style issue fixes

parent 318f977c
""" Test JSON serialization straw """
"""
Test JSON serialization straw
"""
import unittest
from codejail.safe_exec import json_safe
class JsonSafeTest(unittest.TestCase):
""" Test JSON serialization straw """
"""
Test JSON serialization straw
"""
# Unicode surrogate values
SURROGATE_RANGE = range(55296, 57344)
def test_unicode(self):
""" Test that json_safe() handles non-surrogate unicode values """
"""
Test that json_safe() handles non-surrogate unicode values
"""
# Try a few non-ascii UTF-16 characters
for unicode_char in [unichr(512), unichr(2**8-1), unichr(2**16-1)]:
......@@ -24,7 +31,9 @@ class JsonSafeTest(unittest.TestCase):
self.assertEqual(result.get(unicode_char, None), 'test')
def test_surrogate_unicode_values(self):
""" Test that json_safe() excludes surrogate unicode values """
"""
Test that json_safe() excludes surrogate unicode values
"""
# Try surrogate unicode values
for code in self.SURROGATE_RANGE:
......@@ -36,7 +45,9 @@ class JsonSafeTest(unittest.TestCase):
self.assertFalse('test' in result)
def test_surrogate_unicode_keys(self):
""" Test that json_safe() excludes surrogate unicode keys """
"""
Test that json_safe() excludes surrogate unicode keys
"""
# Try surrogate unicode values
for code in self.SURROGATE_RANGE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment