Merge pull request #10280 from bcoca/jsonify_test_nospace

changed jsonify test to ignore whitespace
pull/10290/head
Brian Coca 10 years ago
commit a94d78181d

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

Loading…
Cancel
Save