diff options
Diffstat (limited to 'morphlib/util_tests.py')
-rw-r--r-- | morphlib/util_tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/morphlib/util_tests.py b/morphlib/util_tests.py index 715892b6..bfc7c324 100644 --- a/morphlib/util_tests.py +++ b/morphlib/util_tests.py @@ -14,6 +14,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +import json import os import shutil import tempfile @@ -136,3 +137,12 @@ class IterTrickleTests(unittest.TestCase): def test_truncated_final_sequence(self): self.assertEqual(list(morphlib.util.iter_trickle("barquux", 3)), [["b", "a", "r"], ["q", "u", "u"], ["x"]]) + + +class SafeishJSONEncoderTests(unittest.TestCase): + + def _encode(self, obj): + return json.dumps(obj, cls=morphlib.util.SafeishJSONEncoder):w + + def test_non_ascii_characters(self): + j |