diff --git a/testsuite/tests/kuadrant/authorino/identity/api_key/test_auth_credentials.py b/testsuite/tests/kuadrant/authorino/identity/api_key/test_auth_credentials.py index f0a42151..26e0c7ab 100644 --- a/testsuite/tests/kuadrant/authorino/identity/api_key/test_auth_credentials.py +++ b/testsuite/tests/kuadrant/authorino/identity/api_key/test_auth_credentials.py @@ -21,23 +21,35 @@ def authorization(authorization, api_key, credentials): def test_custom_selector(client, auth, credentials): """Test if auth credentials are stored in right place""" response = client.get("/get", headers={"authorization": "API_KEY " + auth.api_key}) - assert response.status_code == 200 if credentials == "authorization_header" else 401 + if credentials == "authorizationHeader": + assert response.status_code == 200 + else: + assert response.status_code == 401 def test_custom_header(client, auth, credentials): """Test if auth credentials are stored in right place""" response = client.get("/get", headers={"API_KEY": auth.api_key}) - assert response.status_code == 200 if credentials == "custom_header" else 401 + if credentials == "customHeader": + assert response.status_code == 200 + else: + assert response.status_code == 401 def test_query(client, auth, credentials): """Test if auth credentials are stored in right place""" response = client.get("/get", params={"API_KEY": auth.api_key}) - assert response.status_code == 200 if credentials == "query" else 401 + if credentials == "queryString": + assert response.status_code == 200 + else: + assert response.status_code == 401 def test_cookie(route, auth, credentials): """Test if auth credentials are stored in right place""" with route.client(cookies={"API_KEY": auth.api_key}) as client: response = client.get("/get") - assert response.status_code == 200 if credentials == "cookie" else 401 + if credentials == "cookie": + assert response.status_code == 200 + else: + assert response.status_code == 401