1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Clean up jsonify unit test with format to remove json lib differences

This commit is contained in:
James Cammarata 2016-02-29 15:08:59 -05:00
parent 7c049c3200
commit c56e3aabfb

View file

@ -28,7 +28,9 @@ class TestJsonify(unittest.TestCase):
self.assertEqual(jsonify(dict(a=1, b=2, c=3)), '{"a": 1, "b": 2, "c": 3}')
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):
self.assertEqual(jsonify(dict(toshio=u'くらとみ')), u'{"toshio": "くらとみ"}')