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

Merge pull request #10280 from bcoca/jsonify_test_nospace

changed jsonify test to ignore whitespace
This commit is contained in:
Brian Coca 2015-02-18 13:08:14 -05:00
commit a94d78181d

View file

@ -182,8 +182,8 @@ class TestUtils(unittest.TestCase):
def test_jsonify(self):
self.assertEqual(ansible.utils.jsonify(None), '{}')
self.assertEqual(ansible.utils.jsonify(dict(foo='bar', baz=['qux'])), '{"baz": ["qux"], "foo": "bar"}')
expected = u'{\n "baz": [\n "qux"\n ],\n "foo": "bar"\n}'
self.assertEqual(ansible.utils.jsonify(dict(foo='bar', baz=['qux']), format=True), expected)
expected = u'{"baz":["qux"],"foo":"bar"}'
self.assertEqual("".join(ansible.utils.jsonify(dict(foo='bar', baz=['qux']), format=True).split()), expected)
def test_is_failed(self):
self.assertEqual(ansible.utils.is_failed(dict(rc=0)), False)