mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
test_rpcserver: Expect updated error message under Python 3
Python 3's JSON module provides line number information in its parsing error. Update the test to expect this. Part of the work for: https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
9477cddfeb
commit
9ca450ac43
@ -213,7 +213,10 @@ class test_jsonserver(PluginTester):
|
||||
# Test with invalid JSON-data:
|
||||
e = raises(errors.JSONError, o.unmarshal, 'this wont work')
|
||||
assert isinstance(e.error, ValueError)
|
||||
assert unicode(e.error) == 'No JSON object could be decoded'
|
||||
if six.PY2:
|
||||
assert unicode(e.error) == 'No JSON object could be decoded'
|
||||
else:
|
||||
assert str(e.error).startswith('Expecting value: ')
|
||||
|
||||
# Test with non-dict type:
|
||||
e = raises(errors.JSONError, o.unmarshal, json.dumps([1, 2, 3]))
|
||||
|
Loading…
Reference in New Issue
Block a user