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', [