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:
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}')
|
||||
|
||||
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": "くらとみ"}')
|
||||
|
|
Loading…
Reference in a new issue