Skip to content

Commit 3fcb6a8

Browse files
authored
fix(test): resolve duplicate parametrization of credentials fixture (Kuadrant#1005)
Signed-off-by: Silvia Tarabova <starabov@redhat.com>
1 parent 79e29e9 commit 3fcb6a8

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

testsuite/tests/singlecluster/authorino/identity/api_key/test_auth_credentials.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
pytestmark = [pytest.mark.authorino]
88

99

10-
@pytest.fixture(scope="module", params=["authorizationHeader", "customHeader", "queryString", "cookie"])
10+
@pytest.fixture(scope="module")
1111
def credentials(request):
1212
"""Location where are auth credentials passed"""
1313
return request.param
@@ -36,6 +36,11 @@ def test_custom_selector(client, auth, credentials):
3636
assert response.status_code == 401
3737

3838

39+
@pytest.mark.parametrize(
40+
"credentials",
41+
["authorizationHeader", "customHeader", "queryString", "cookie"],
42+
indirect=True,
43+
)
3944
def test_custom_header(client, auth, credentials):
4045
"""Test if auth credentials are stored in right place"""
4146
response = client.get("/get", headers={"APIKEY": auth.api_key})
@@ -45,6 +50,11 @@ def test_custom_header(client, auth, credentials):
4550
assert response.status_code == 401
4651

4752

53+
@pytest.mark.parametrize(
54+
"credentials",
55+
["authorizationHeader", "customHeader", "queryString", "cookie"],
56+
indirect=True,
57+
)
4858
def test_query(client, auth, credentials):
4959
"""Test if auth credentials are stored in right place"""
5060
response = client.get("/get", params={"APIKEY": auth.api_key})
@@ -54,6 +64,11 @@ def test_query(client, auth, credentials):
5464
assert response.status_code == 401
5565

5666

67+
@pytest.mark.parametrize(
68+
"credentials",
69+
["authorizationHeader", "customHeader", "queryString", "cookie"],
70+
indirect=True,
71+
)
5772
def test_cookie(hostname, auth, credentials):
5873
"""Test if auth credentials are stored in right place"""
5974
with hostname.client(cookies={"APIKEY": auth.api_key}) as client:

0 commit comments

Comments
 (0)