changeset 8044:91103995888b

tests: fix ordering of options of "ret_type must be one of ..." returned from api Py3 would fail becauase it use another ordering.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 26 Dec 2019 05:36:00 +0100
parents 7986422cacb3
children 05e28260b812
files kallithea/controllers/api/api.py kallithea/tests/api/api_base.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/api/api.py	Thu Dec 26 11:29:26 2019 +0100
+++ b/kallithea/controllers/api/api.py	Thu Dec 26 05:36:00 2019 +0100
@@ -1160,7 +1160,7 @@
             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(
--- a/kallithea/tests/api/api_base.py	Thu Dec 26 11:29:26 2019 +0100
+++ b/kallithea/tests/api/api_base.py	Thu Dec 26 05:36:00 2019 +0100
@@ -807,7 +807,7 @@
         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', [