Delete Method
unknown
plain_text
4 years ago
2.6 kB
9
Indexable
self = <galaxy_test.api.test_group_users.GroupUsersApiTestCase testMethod=test_delete_unknown_raises_400>
def test_delete_unknown_raises_400(self):
group_name = "group-without-user-to-delete"
group = self._create_group(group_name, encoded_user_ids=[])
encoded_group_id = group["id"]
group_users = self._get_group_users(encoded_group_id)
assert len(group_users) == 0
encoded_user_id = "unknown-user-id"
delete_response = self._delete(f"groups/{encoded_group_id}/users/{encoded_user_id}", admin=True)
> self._assert_status_code_is(delete_response, 400)
lib/galaxy_test/api/test_group_users.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
lib/galaxy_test/base/api.py:114: in _assert_status_code_is
assert_status_code_is(response, expected_status_code)
lib/galaxy_test/base/api_asserts.py:22: in assert_status_code_is
_report_status_code_error(response, expected_status_code)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
response = <Response [404]>, expected_status_code = 400
def _report_status_code_error(response: Response, expected_status_code: Union[str, int]):
try:
body = response.json()
except Exception:
body = f"INVALID JSON RESPONSE <{response.text}>"
assertion_message = ASSERT_FAIL_STATUS_CODE % (response.status_code, expected_status_code, body)
> raise AssertionError(assertion_message)
E AssertionError: Request status code (404) was not expected value 400. Body was INVALID JSON RESPONSE <<html>
E <head>
E <title>404 Not Found</title>
E </head>
E <body>
E <h1>404 Not Found</h1>
E The resource could not be found.<br /><br />
E No route for /api/groups/529fd61ab1c6cc36/users/unknown-user-id
E
E
E </body>
E </html>>
lib/galaxy_test/base/api_asserts.py:45: AssertionError
------------------------------Captured stdout call------------------------------
INFO: 127.0.0.1:58288 - "GET /api/users HTTP/1.1" 200 OK
INFO: 127.0.0.1:58289 - "POST /api/users/adb5f5c93f827949/api_key HTTP/1.1" 200 OK
INFO: 127.0.0.1:58290 - "POST /api/groups HTTP/1.1" 200 OK
INFO: 127.0.0.1:58291 - "GET /api/groups/529fd61ab1c6cc36/users HTTP/1.1" 200 OK
INFO: 127.0.0.1:58292 - "DELETE /api/groups/529fd61ab1c6cc36/users/unknown-user-id HTTP/1.1" 404 Not Found
INFO: 127.0.0.1:58293 - "GET /api/jobs?state=running&?user_details=true HTTP/1.1" 200 OK
Editor is loading...