Issue #1412
closed
Login with wrong credentials returns incorrect error data keys
Tags:
Documentation, Pulp 2
Description
After logging into pulp-admin with incorrect username and password, set of data keys returned in body differs from those described in documentation [1]. Output from test [2] in pulp-smash framework [3] testing this functionality follows. Tested on pulp 2.6 release and 2.7 release.
$ python -m unittest2 pulp_smash.tests.platform.api_v2.test_login.LoginFailureTestCase
F.
======================================================================
FAIL: test_body (pulp_smash.tests.platform.api_v2.test_login.LoginFailureTestCase)
Assert that the response is valid JSON and has correct keys.
----------------------------------------------------------------------
Traceback (most recent call last):
File "pulp_smash/tests/platform/api_v2/test_login.py", line 56, in test_body
self.assertEqual(frozenset(self.response.json().keys()), ERROR_KEYS)
AssertionError: Items in the first set but not the second:
u'http_request_method'
u'auth_error_code'
----------------------------------------------------------------------
Ran 2 tests in 0.815s
FAILED (failures=1)
[1] https://pulp.readthedocs.org/en/latest/dev-guide/conventions/exceptions.html
[2] https://github.com/PulpQE/pulp-smash/blob/master/pulp_smash/tests/platform/api_v2/test_login.py#L37
[3] https://github.com/PulpQE/pulp-smash/
- Version set to 2.7.0
- OS set to RHEL 7
I would close one of this bugs https://pulp.plan.io/issues/1413 since the nature of the issue is the same,and make a generic bug summary, like 'Error data keys described in the docs are different from real body response'
I think we should just update the docs with 'http_request_method' key and add a comment that depending of the type of the issue there could be addition keys(for example the 404 will have 'resources and 400 will have 'property_names').
- Related to Issue #1413: Creating repository with invalid request body returns incorrert error data keys added
I would close one of this bugs https://pulp.plan.io/issues/1413 since the nature of the issue is the same,and make a generic bug summary, like 'Error data keys described in the docs are different from real body response'
If you think all of the errors can be fixed at once, then sure. Pulp Smash chooses to run or skip tests based on the state of pulp.plan.io issues. Let's say we create a single issue describing a class of error that's encountered by fifteen different tests, and then close the issue. In that case, all fifteen skipped tess will start running again. So writing lots of similar bug reports can be annoying, but doing so lets us start fixing bugs and testing those fixes in a more granular manner.
I think we should just update the docs with 'http_request_method' key and add a comment that depending of the type of the issue there could be addition keys
Makes sense. Note that one of the five buggy API calls is missing a key. That API call is deserving of a separate fix.
- Triaged changed from No to Yes
- Status changed from NEW to CLOSED - WONTFIX
Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.
We are removing the 'API' category per open floor discussion June 16, 2020.
Also available in: Atom
PDF