@ -52,9 +52,9 @@ class TestApiKeyAuthService:
ApiKeyAuthService . get_provider_auth_list ( self . tenant_id )
ApiKeyAuthService . get_provider_auth_list ( self . tenant_id )
# Verify filter conditions include disabled.is_(False)
# Verify where conditions include disabled.is_(False)
filter _call = mock_session . query . return_value . filter . call_args [ 0 ]
where _call = mock_session . query . return_value . where . call_args [ 0 ]
assert len ( filter _call) == 2 # tenant_id and disabled filter conditions
assert len ( where _call) == 2 # tenant_id and disabled filter conditions
@patch ( " services.auth.api_key_auth_service.db.session " )
@patch ( " services.auth.api_key_auth_service.db.session " )
@patch ( " services.auth.api_key_auth_service.ApiKeyAuthFactory " )
@patch ( " services.auth.api_key_auth_service.ApiKeyAuthFactory " )
@ -162,9 +162,9 @@ class TestApiKeyAuthService:
ApiKeyAuthService . get_auth_credentials ( self . tenant_id , self . category , self . provider )
ApiKeyAuthService . get_auth_credentials ( self . tenant_id , self . category , self . provider )
# Verify filter conditions are correct
# Verify where conditions are correct
filter _call = mock_session . query . return_value . filter . call_args [ 0 ]
where _call = mock_session . query . return_value . where . call_args [ 0 ]
assert len ( filter _call) == 4 # tenant_id, category, provider, disabled
assert len ( where _call) == 4 # tenant_id, category, provider, disabled
@patch ( " services.auth.api_key_auth_service.db.session " )
@patch ( " services.auth.api_key_auth_service.db.session " )
def test_get_auth_credentials_json_parsing ( self , mock_session ) :
def test_get_auth_credentials_json_parsing ( self , mock_session ) :
@ -212,9 +212,9 @@ class TestApiKeyAuthService:
ApiKeyAuthService . delete_provider_auth ( self . tenant_id , self . binding_id )
ApiKeyAuthService . delete_provider_auth ( self . tenant_id , self . binding_id )
# Verify filter conditions include tenant_id and binding_id
# Verify where conditions include tenant_id and binding_id
filter _call = mock_session . query . return_value . filter . call_args [ 0 ]
where _call = mock_session . query . return_value . where . call_args [ 0 ]
assert len ( filter _call) == 2
assert len ( where _call) == 2
def test_validate_api_key_auth_args_success ( self ) :
def test_validate_api_key_auth_args_success ( self ) :
""" Test API key auth args validation - success scenario """
""" Test API key auth args validation - success scenario """