Skip to content

Commit 39ec6a5

Browse files
committed
fix(tests): update middleware tests to remove deprecated mode parameter
Remove mode="local" usage and update test_invalid_mode_raises to test_partial_cloud_config_raises, reflecting the new cloud_url/api_key API.
1 parent c5a5451 commit 39ec6a5

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

tests/test_middleware.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ def make_app(db_path=":memory:", sampling=1.0, ignore_paths=None):
99
app = FastAPI()
1010
app.add_middleware(
1111
ApiForgeMiddleware,
12-
mode="local",
1312
db_path=db_path,
1413
dashboard_port=0,
1514
flush_interval=999_999,

tests/test_smoke.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ def make_app(db_path=":memory:"):
99
app = FastAPI()
1010
app.add_middleware(
1111
ApiForgeMiddleware,
12-
mode="local",
1312
db_path=db_path,
1413
dashboard_port=0,
1514
flush_interval=999_999,
@@ -62,10 +61,10 @@ def test_multiple_methods():
6261
assert client.post("/users").status_code == 200
6362

6463

65-
def test_invalid_mode_raises():
66-
with pytest.raises(ValueError, match="not yet supported"):
64+
def test_partial_cloud_config_raises():
65+
with pytest.raises(ValueError, match="both cloud_url and api_key"):
6766
app = FastAPI()
68-
app.add_middleware(ApiForgeMiddleware, mode="saas", dashboard_port=0)
67+
app.add_middleware(ApiForgeMiddleware, cloud_url="https://api.apiforge.fr", dashboard_port=0)
6968
client = TestClient(app)
7069
client.get("/")
7170

0 commit comments

Comments
 (0)