Statistiche per sessione di produzione: filtro production_run_id, elenco sessioni, select Sessione (#58)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -112,3 +112,21 @@ class TestSPCProxy:
|
||||
assert resp.status_code == 200
|
||||
data = resp.get_json()
|
||||
assert "cp" in data
|
||||
|
||||
|
||||
class TestRunsProxy:
|
||||
"""#58: filtro per sessione di produzione."""
|
||||
|
||||
def test_runs_proxy(self, logged_in_client, mock_api_client):
|
||||
mock_api_client.get.return_value = [{"id": 5, "measurement_count": 3}]
|
||||
resp = logged_in_client.get("/statistics/api/runs?recipe_id=7")
|
||||
assert resp.status_code == 200
|
||||
assert resp.get_json()[0]["id"] == 5
|
||||
args, kwargs = mock_api_client.get.call_args
|
||||
assert args[0] == "/api/statistics/runs"
|
||||
assert kwargs["params"] == {"recipe_id": "7"}
|
||||
|
||||
def test_summary_forwards_production_run_id(self, logged_in_client, mock_api_client):
|
||||
mock_api_client.get.return_value = {"total": 1}
|
||||
logged_in_client.get("/statistics/api/summary?recipe_id=1&production_run_id=5")
|
||||
assert mock_api_client.get.call_args.kwargs["params"]["production_run_id"] == "5"
|
||||
|
||||
Reference in New Issue
Block a user