fix: gross-based batch discard, direction-correct event logs, wire CSV logger
ci / smoke (push) Canceled after 0s
ci / smoke (push) Canceled after 0s
This commit is contained in:
1 parent
508bee736d
commit
d3357fccef
8 files changed
+200
-22
No files matched your search
+21
-2
@@ -39,7 +39,8 @@ def test_net_counts_and_discard():
|
||||
assert should_discard_batch(0, 0) is True
|
||||
assert should_discard_batch(1, 0) is False
|
||||
assert should_discard_batch(0, 1) is False
|
||||
assert should_discard_batch(-1, 0) is False
|
||||
assert should_discard_batch(0, 7) is False
|
||||
assert should_discard_batch(5, 0) is False
|
||||
|
||||
|
||||
def test_classify_unit_tokens():
|
||||
@@ -265,7 +266,7 @@ def test_start_stop_auto_409(dash_client):
|
||||
assert res.status_code == 409
|
||||
|
||||
|
||||
def test_stop_discard_both_nets_zero(dash_client):
|
||||
def test_stop_discard_gross_zero(dash_client):
|
||||
client, mode_path, state_path, _ = dash_client
|
||||
office = {"Host": f"localhost:{cd_office_port()}"}
|
||||
client.post("/api/batch/mode", json={"mode": "manual"}, headers=office)
|
||||
@@ -283,6 +284,24 @@ def test_stop_discard_both_nets_zero(dash_client):
|
||||
assert not state_path.exists()
|
||||
|
||||
|
||||
def test_stop_discards_zero_loading_with_unloading(dash_client):
|
||||
client, mode_path, state_path, _ = dash_client
|
||||
office = {"Host": f"localhost:{cd_office_port()}"}
|
||||
client.post("/api/batch/mode", json={"mode": "manual"}, headers=office)
|
||||
state_path.write_text(json.dumps({
|
||||
"counting_date": "2026-09-24", "batch_number": 97,
|
||||
"count": 0, "box_count": 0, "box_unloading": 0, "unloading": 7,
|
||||
"start_time": "2026-09-24T00:00:00",
|
||||
"model_mode": "C",
|
||||
}))
|
||||
res = client.post("/api/batch/stop", headers={"Host": "localhost:5000"})
|
||||
body = res.get_json()
|
||||
assert res.status_code == 200
|
||||
assert body["discarded"] is True
|
||||
assert body["net_sack"] == -7
|
||||
assert not state_path.exists()
|
||||
|
||||
|
||||
def test_stop_keeps_box_only_batch(dash_client):
|
||||
client, mode_path, state_path, _ = dash_client
|
||||
office = {"Host": f"localhost:{cd_office_port()}"}
|
||||
|
||||
Reference in new issue
Block a user