Add 'fiscal/' from commit '102ba84500dbd9655a0471288c3e278652593ca9'
git-subtree-dir: fiscal git-subtree-mainline:d95165fc8fgit-subtree-split:102ba84500
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
from central.app.operational_state import classify_product_state, summarize_operational_states
|
||||
|
||||
|
||||
def test_twenty_thousand_products_keep_agent_healthy_with_safe_blocks():
|
||||
states = [{"state": "COMPLETE"}] * 19900 + [{"state": "BLOCKED_MISSING_EVIDENCE"}] * 100
|
||||
summary = summarize_operational_states(states)
|
||||
|
||||
assert summary["AUTONOMOUSLY_PROCESSABLE_PRODUCTS"] == 20000
|
||||
assert summary["SAFE_BLOCKED"] == 100
|
||||
assert summary["AGENT_HEALTH"] == "HEALTHY"
|
||||
|
||||
|
||||
def test_new_evidence_changes_product_state_without_global_failure():
|
||||
blocked = classify_product_state({"CODIGO": "P1"}, {"status": "INVALID_NCM"})
|
||||
resolved = classify_product_state({"CODIGO": "P1"}, {"status": "EXACT_NCM"})
|
||||
|
||||
assert blocked["state"] == "BLOCKED_MISSING_EVIDENCE"
|
||||
assert resolved["state"] == "COMPLETE"
|
||||
Reference in New Issue
Block a user