From 1e266919117778cd5878452c3deb8f135831d330 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 28 2015 09:10:18 +0000 Subject: Adjust the EINVALIDTOK error message and adjust the unit-tests accordingly --- diff --git a/pagure/api/__init__.py b/pagure/api/__init__.py index ad6f5cb..44ace7c 100644 --- a/pagure/api/__init__.py +++ b/pagure/api/__init__.py @@ -33,7 +33,7 @@ class APIERROR(enum.Enum): EDBERROR = 'An error occured at the database level and prevent the ' \ 'action from reaching completion' EINVALIDREQ = 'Invalid or incomplete input submited' - EINVALIDTOK = 'Invalid or expired token. Please visit %s get or '\ + EINVALIDTOK = 'Invalid or expired token. Please visit %s to get or '\ 'renew your API token.' % APP.config['APP_URL'] ENOISSUE = 'Issue not found' EISSUEREST = 'You are not allowed to view this issue' diff --git a/tests/test_progit_flask_api_auth.py b/tests/test_progit_flask_api_auth.py index 55d07b3..2850459 100644 --- a/tests/test_progit_flask_api_auth.py +++ b/tests/test_progit_flask_api_auth.py @@ -51,7 +51,7 @@ class PagureFlaskApiAuthtests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -65,7 +65,7 @@ class PagureFlaskApiAuthtests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -83,7 +83,7 @@ class PagureFlaskApiAuthtests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -97,7 +97,7 @@ class PagureFlaskApiAuthtests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -115,7 +115,7 @@ class PagureFlaskApiAuthtests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -129,7 +129,7 @@ class PagureFlaskApiAuthtests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -149,7 +149,7 @@ class PagureFlaskApiAuthtests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) diff --git a/tests/test_progit_flask_api_fork.py b/tests/test_progit_flask_api_fork.py index 99aa9a6..6b4a7ec 100644 --- a/tests/test_progit_flask_api_fork.py +++ b/tests/test_progit_flask_api_fork.py @@ -339,7 +339,7 @@ class PagureFlaskApiForktests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -449,7 +449,7 @@ class PagureFlaskApiForktests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -540,7 +540,7 @@ class PagureFlaskApiForktests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) diff --git a/tests/test_progit_flask_api_issue.py b/tests/test_progit_flask_api_issue.py index 24cfe10..67234b4 100644 --- a/tests/test_progit_flask_api_issue.py +++ b/tests/test_progit_flask_api_issue.py @@ -62,7 +62,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -494,7 +494,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } ) @@ -672,7 +672,7 @@ class PagureFlaskApiIssuetests(tests.Modeltests): data, { "error": "Invalid or expired token. Please visit " \ - "https://pagure.org/ get or renew your API token.", + "https://pagure.org/ to get or renew your API token.", "error_code": "EINVALIDTOK", } )