# HG changeset patch # User Mads Kiilerich # Date 2019-12-26 05:36:00 # Node ID 91103995888bbdddb627ef9e8647881324d3802f # Parent 7986422cacb3a21c26ad895c5edff68040a59606 tests: fix ordering of options of "ret_type must be one of ..." returned from api Py3 would fail becauase it use another ordering. diff --git a/kallithea/controllers/api/api.py b/kallithea/controllers/api/api.py --- a/kallithea/controllers/api/api.py +++ b/kallithea/controllers/api/api.py @@ -1160,7 +1160,7 @@ class ApiController(JSONRPCController): return _map[ret_type] except KeyError: raise JSONRPCError('ret_type must be one of %s' - % (','.join(_map.keys()))) + % (','.join(sorted(_map)))) except Exception: log.error(traceback.format_exc()) raise JSONRPCError( diff --git a/kallithea/tests/api/api_base.py b/kallithea/tests/api/api_base.py --- a/kallithea/tests/api/api_base.py +++ b/kallithea/tests/api/api_base.py @@ -807,7 +807,7 @@ class _BaseTestApi(object): response = api_call(self, params) expected = ('ret_type must be one of %s' - % (','.join(['files', 'dirs', 'all']))) + % (','.join(sorted(['files', 'dirs', 'all'])))) self._compare_error(id_, expected, given=response.body) @parametrize('name,ret_type,grant_perm', [