Clean up jsonify unit test with format to remove json lib differences
This commit is contained in:
parent
7c049c3200
commit
c56e3aabfb
1 changed files with 3 additions and 1 deletions
|
@ -28,7 +28,9 @@ class TestJsonify(unittest.TestCase):
|
||||||
self.assertEqual(jsonify(dict(a=1, b=2, c=3)), '{"a": 1, "b": 2, "c": 3}')
|
self.assertEqual(jsonify(dict(a=1, b=2, c=3)), '{"a": 1, "b": 2, "c": 3}')
|
||||||
|
|
||||||
def test_jsonify_simple_format(self):
|
def test_jsonify_simple_format(self):
|
||||||
self.assertEqual(jsonify(dict(a=1, b=2, c=3), format=True), '{\n "a": 1, \n "b": 2, \n "c": 3\n}')
|
res = jsonify(dict(a=1, b=2, c=3), format=True)
|
||||||
|
cleaned = "".join([x.strip() for x in res.splitlines()])
|
||||||
|
self.assertEqual(cleaned, '{"a": 1,"b": 2,"c": 3}')
|
||||||
|
|
||||||
def test_jsonify_unicode(self):
|
def test_jsonify_unicode(self):
|
||||||
self.assertEqual(jsonify(dict(toshio=u'くらとみ')), u'{"toshio": "くらとみ"}')
|
self.assertEqual(jsonify(dict(toshio=u'くらとみ')), u'{"toshio": "くらとみ"}')
|
||||||
|
|
Loading…
Reference in a new issue