Skip to content

Commit db3144e

Browse files
committed
test(mongodb): remove client fixture to avoid VCR/cassettes dependency in unit test
1 parent 43740e5 commit db3144e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scaleway/scaleway/mongodb/v1/tests/test_custom_api.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
from scaleway.mongodb.v1.api import MongodbV1API
66
from scaleway.mongodb.v1.custom_api import MongodbUtilsV1API
7-
from tests.utils import initialize_client_test
7+
8+
class _DummyClient:
9+
pass
810

911
# mypy: ignore-errors
1012

@@ -21,7 +23,7 @@ def dummy(self, **kwargs): # type: ignore[no-untyped-def]
2123

2224
monkeypatch.setattr(MongodbV1API, method_name, dummy, raising=True)
2325

24-
api = MongodbUtilsV1API(client=initialize_client_test(), bypass_validation=True)
26+
api = MongodbUtilsV1API(client=_DummyClient(), bypass_validation=True)
2527

2628
# Build naive datetime without triggering DTZ001 (construct aware then strip tz)
2729
naive_dt = datetime(2030, 1, 1, 12, 0, 0, tzinfo=timezone.utc).replace(tzinfo=None)
@@ -50,7 +52,7 @@ def dummy(self, **kwargs): # type: ignore[no-untyped-def]
5052

5153
monkeypatch.setattr(MongodbV1API, method_name, dummy, raising=True)
5254

53-
api = MongodbUtilsV1API(client=initialize_client_test(), bypass_validation=True)
55+
api = MongodbUtilsV1API(client=_DummyClient(), bypass_validation=True)
5456

5557
aware_dt = datetime(2030, 1, 1, 12, 0, 0, tzinfo=timezone.utc)
5658

0 commit comments

Comments
 (0)