(self)
| 55 | self.assertTrue(transformed_obj["yo"] == "bibimbao") |
| 56 | |
| 57 | def test_try_loads(self): |
| 58 | # The function json.loads will fail and the function should return the original value. |
| 59 | values = ["abc", 123, True, object()] |
| 60 | for value in values: |
| 61 | self.assertEqual(jsonify.try_loads(value), value) |
| 62 | |
| 63 | # The function json.loads succeed. |
| 64 | d = '{"a": 1, "b": true}' |
| 65 | expected = {"a": 1, "b": True} |
| 66 | self.assertDictEqual(jsonify.try_loads(d), expected) |
| 67 | |
| 68 | def test_json_encode_decode_roundtrip_compatibility_between_different_libs(self): |
| 69 | class ObjectWithJsonMethod(object): |
nothing calls this directly
no outgoing calls
no test coverage detected