77import pytest
88
99from deepset_mcp .api .exceptions import ResourceNotFoundError , UnexpectedAPIError
10- from deepset_mcp .api .integrations .models import Integration , IntegrationList , IntegrationProvider
10+ from deepset_mcp .api .integrations .models import Integration , IntegrationProvider
1111from deepset_mcp .api .integrations .protocols import IntegrationResourceProtocol
1212from deepset_mcp .api .secrets .models import Secret
1313from deepset_mcp .api .secrets .protocols import SecretResourceProtocol
@@ -63,7 +63,7 @@ async def delete(self, secret_id: str) -> NoContentResponse:
6363class FakeIntegrationResource (IntegrationResourceProtocol ):
6464 def __init__ (
6565 self ,
66- list_response : IntegrationList | None = None ,
66+ list_response : list [ Integration ] | None = None ,
6767 get_response : Integration | None = None ,
6868 list_exception : Exception | None = None ,
6969 get_exception : Exception | None = None ,
@@ -73,11 +73,11 @@ def __init__(
7373 self .list_exception = list_exception
7474 self .get_exception = get_exception
7575
76- async def list (self ) -> IntegrationList :
76+ async def list (self ) -> list [ Integration ] :
7777 if self .list_exception :
7878 raise self .list_exception
7979 if self .list_response is None :
80- return IntegrationList ( integrations = [])
80+ return []
8181 return self .list_response
8282
8383 async def get (self , provider : IntegrationProvider ) -> Integration :
@@ -112,15 +112,14 @@ async def test_list_secrets_and_integrations() -> None:
112112 secret_list = PaginatedResponse [Secret ](data = secrets_data , has_more = False , total = 1 )
113113
114114 integration_id = uuid .uuid4 ()
115- integrations_data = [
115+ integration_list = [
116116 Integration (
117117 invalid = False ,
118118 model_registry_token_id = integration_id ,
119119 provider = IntegrationProvider .OPENAI ,
120120 provider_domain = "api.openai.com" ,
121121 )
122122 ]
123- integration_list = IntegrationList (integrations = integrations_data )
124123
125124 client = FakeClient (
126125 secret_resource = FakeSecretResource (list_response = secret_list ),
@@ -169,15 +168,14 @@ async def test_list_secrets_only() -> None:
169168async def test_list_integrations_only () -> None :
170169 """Test listing only integrations when no secrets exist."""
171170 integration_id = uuid .uuid4 ()
172- integrations_data = [
171+ integration_list = [
173172 Integration (
174173 invalid = True ,
175174 model_registry_token_id = integration_id ,
176175 provider = IntegrationProvider .COHERE ,
177176 provider_domain = "api.cohere.ai" ,
178177 )
179178 ]
180- integration_list = IntegrationList (integrations = integrations_data )
181179 client = FakeClient (integration_resource = FakeIntegrationResource (list_response = integration_list ))
182180
183181 result = await list_secrets (client = client )
@@ -238,15 +236,14 @@ async def test_get_secret_by_id_success() -> None:
238236async def test_get_integration_by_id_success () -> None :
239237 """Test successful retrieval of an integration by its ID."""
240238 integration_id = uuid .uuid4 ()
241- integrations_data = [
239+ integration_list = [
242240 Integration (
243241 invalid = False ,
244242 model_registry_token_id = integration_id ,
245243 provider = IntegrationProvider .OPENAI ,
246244 provider_domain = "api.openai.com" ,
247245 )
248246 ]
249- integration_list = IntegrationList (integrations = integrations_data )
250247
251248 client = FakeClient (
252249 secret_resource = FakeSecretResource (get_exception = ResourceNotFoundError ("Not found" )),
0 commit comments