77pytestmark = [pytest .mark .authorino ]
88
99
10- @pytest .fixture (scope = "module" , params = [ "authorizationHeader" , "customHeader" , "queryString" , "cookie" ] )
10+ @pytest .fixture (scope = "module" )
1111def 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+ )
3944def 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+ )
4858def 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+ )
5772def 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