diff options
author | Petr Viktorin <pviktori@redhat.com> | 2016-05-06 17:43:06 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-05-30 16:44:08 +0200 |
commit | 9ca450ac436344afd3a46d9852d8329a2e9a48d2 (patch) | |
tree | ed059f2e7fb911656b6a193651dbbb727fc8d87f /ipatests/test_ipaserver | |
parent | 9477cddfeb9adc03e039155ce3b8a0b560f71098 (diff) | |
download | freeipa-9ca450ac436344afd3a46d9852d8329a2e9a48d2.tar.gz freeipa-9ca450ac436344afd3a46d9852d8329a2e9a48d2.tar.xz freeipa-9ca450ac436344afd3a46d9852d8329a2e9a48d2.zip |
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>
Diffstat (limited to 'ipatests/test_ipaserver')
-rw-r--r-- | ipatests/test_ipaserver/test_rpcserver.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ipatests/test_ipaserver/test_rpcserver.py b/ipatests/test_ipaserver/test_rpcserver.py index 03a4cebb2..94ebd062c 100644 --- a/ipatests/test_ipaserver/test_rpcserver.py +++ b/ipatests/test_ipaserver/test_rpcserver.py @@ -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])) |