feat(api): standardize REST contracts and auth
This commit is contained in:
@@ -92,8 +92,8 @@ def test_calculate_service_area_contract_uses_only_network(monkeypatch):
|
||||
)
|
||||
client = TestClient(build_test_app(module.router, "/api/v1"))
|
||||
|
||||
response = client.get(
|
||||
"/api/v1/calculateservicearea/",
|
||||
response = client.post(
|
||||
"/api/v1/service-area-calculations",
|
||||
params={"network": "demo", "time_index": 5},
|
||||
)
|
||||
schema = client.get("/openapi.json").json()
|
||||
@@ -103,7 +103,7 @@ def test_calculate_service_area_contract_uses_only_network(monkeypatch):
|
||||
assert calls == ["demo"]
|
||||
parameter_names = [
|
||||
item["name"]
|
||||
for item in schema["paths"]["/api/v1/calculateservicearea/"]["get"]["parameters"]
|
||||
for item in schema["paths"]["/api/v1/service-area-calculations"]["post"]["parameters"]
|
||||
]
|
||||
assert parameter_names == ["network"]
|
||||
|
||||
@@ -121,7 +121,7 @@ def test_add_district_metering_area_converts_boundary_to_tuples(monkeypatch):
|
||||
client = TestClient(build_test_app(module.router, "/api/v1"))
|
||||
|
||||
response = client.post(
|
||||
"/api/v1/adddistrictmeteringarea/",
|
||||
"/api/v1/district-metering-areas",
|
||||
params={"network": "demo"},
|
||||
json={"id": "dma-1", "boundary": [[1, 2], [3, 4], [1, 2]]},
|
||||
)
|
||||
@@ -145,7 +145,7 @@ def test_generate_virtual_district_reads_centers_from_body(monkeypatch):
|
||||
client = TestClient(build_test_app(module.router, "/api/v1"))
|
||||
|
||||
response = client.post(
|
||||
"/api/v1/generatevirtualdistrict/",
|
||||
"/api/v1/virtual-district-generation-runs",
|
||||
params={"network": "demo", "inflate_delta": 0.75},
|
||||
json={"centers": ["J1", "J2"]},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user