Skip to content

Commit e07cbf1

Browse files
committed
fix(tests): fix wiremock conftest to use base client
1 parent 29c48d5 commit e07cbf1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/wire/conftest.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import pytest
1515
import requests
1616

17-
from deepgram.client import DeepgramApi
17+
from deepgram.base_client import BaseClient
18+
from deepgram.environment import DeepgramClientEnvironment
1819

1920

2021
def _compose_file() -> str:
@@ -87,7 +88,7 @@ def pytest_unconfigure(config: pytest.Config) -> None:
8788
_stop_wiremock()
8889

8990

90-
def get_client(test_id: str) -> DeepgramApi:
91+
def get_client(test_id: str) -> BaseClient:
9192
"""
9293
Creates a configured client instance for wire tests.
9394
@@ -97,8 +98,14 @@ def get_client(test_id: str) -> DeepgramApi:
9798
Returns:
9899
A configured client instance with all required auth parameters.
99100
"""
100-
return DeepgramApi(
101-
base_url="http://localhost:8080",
101+
# Create a custom environment pointing to WireMock
102+
wiremock_environment = DeepgramClientEnvironment(
103+
base="http://localhost:8080",
104+
production="ws://localhost:8080",
105+
agent="ws://localhost:8080",
106+
)
107+
return BaseClient(
108+
environment=wiremock_environment,
102109
headers={"X-Test-Id": test_id},
103110
api_key="test_api_key",
104111
)

0 commit comments

Comments
 (0)