Test failures from incorrect json string escaping
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Meliae |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
As noted in _loader.
=======
FAIL: test_to_json (meliae.
-------
Traceback (most recent call last):
File "meliae\
self.
AssertionError: Lists differ: ['{"address": 1, "type": "tupl... != ['{"address": 1, "type": "tupl...
First differing element 5:
{"address": 6, "type": "str", "size": 29, "value": "a str", "refs": []}
{"address": 6, "type": "str", "size": 29, "value": "a str"", "refs": []}
Diff is 720 characters long. Set self.maxDiff to None to see it.
=======
FAIL: test_expand_
-------
Traceback (most recent call last):
File "meliae\
self.
AssertionError: {1: 'c', 'b': 'c'} != {1: 'c"', 'b"': 'c"'}
- {1: 'c', 'b': 'c'}
+ {1: 'c"', 'b"': 'c"'}
? + + +
It would be possible to use json.encoder.
This patch improves it so that the tests at least pass. Things may still break on some input data, though, so it might be better to use a real parser as bug 871451 suggests.