@@ -41,7 +41,7 @@ class TestTokenRouter:
4141 ("api_auth" , "jwt_expiration_time" ): "10" ,
4242 }
4343 )
44- @patch ("airflow.providers.keycloak.auth_manager.routes .token.create_token_for" )
44+ @patch ("airflow.providers.keycloak.auth_manager.datamodels .token.create_token_for" )
4545 def test_create_token_password_grant (self , mock_create_token_for , client , body ):
4646 mock_create_token_for .return_value = self .token
4747 response = client .post (
@@ -58,7 +58,7 @@ def test_create_token_password_grant(self, mock_create_token_for, client, body):
5858 ("api_auth" , "jwt_expiration_time" ): "10" ,
5959 }
6060 )
61- @patch ("airflow.providers.keycloak.auth_manager.routes .token.create_token_for" )
61+ @patch ("airflow.providers.keycloak.auth_manager.datamodels .token.create_token_for" )
6262 def test_create_token_cli (self , mock_create_token_for , client ):
6363 mock_create_token_for .return_value = self .token
6464 response = client .post (
@@ -74,7 +74,7 @@ def test_create_token_cli(self, mock_create_token_for, client):
7474 ("api_auth" , "jwt_expiration_time" ): "10" ,
7575 }
7676 )
77- @patch ("airflow.providers.keycloak.auth_manager.routes .token.create_client_credentials_token" )
77+ @patch ("airflow.providers.keycloak.auth_manager.datamodels .token.create_client_credentials_token" )
7878 def test_create_token_client_credentials (self , mock_create_client_credentials_token , client ):
7979 mock_create_client_credentials_token .return_value = self .token
8080 response = client .post (
@@ -88,7 +88,9 @@ def test_create_token_client_credentials(self, mock_create_client_credentials_to
8888
8989 assert response .status_code == 201
9090 assert response .json () == {"access_token" : self .token }
91- mock_create_client_credentials_token .assert_called_once_with ("client_id" , "client_secret" )
91+ mock_create_client_credentials_token .assert_called_once_with (
92+ "client_id" , "client_secret" , expiration_time_in_seconds = 10
93+ )
9294
9395 @pytest .mark .parametrize (
9496 "body" ,
@@ -107,7 +109,7 @@ def test_create_token_client_credentials(self, mock_create_client_credentials_to
107109 ("api_auth" , "jwt_expiration_time" ): "10" ,
108110 }
109111 )
110- @patch ("airflow.providers.keycloak.auth_manager.routes .token.create_client_credentials_token" )
112+ @patch ("airflow.providers.keycloak.auth_manager.datamodels .token.create_client_credentials_token" )
111113 def test_create_token_invalid_body (self , mock_create_client_credentials_token , client , body ):
112114 mock_create_client_credentials_token .return_value = self .token
113115 response = client .post (
0 commit comments