test_storage_release_review_hide_voided.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from app.core.protocol_status_display import INACTIVE_PROTOCOL_STATUSES
  2. from app.crud.storage_release_review import (
  3. inbound_work_orders_all_void,
  4. is_inactive_protocol_status_for_hide,
  5. )
  6. def test_inactive_protocol_statuses_match_shared_constant():
  7. assert is_inactive_protocol_status_for_hide("yzf") is True
  8. assert is_inactive_protocol_status_for_hide("sdfq") is True
  9. assert is_inactive_protocol_status_for_hide(" SDFQ ") is True
  10. assert is_inactive_protocol_status_for_hide("sxz") is False
  11. assert is_inactive_protocol_status_for_hide("zky") is False
  12. assert is_inactive_protocol_status_for_hide("") is False
  13. assert is_inactive_protocol_status_for_hide(None) is False
  14. assert set(INACTIVE_PROTOCOL_STATUSES) == {"yzf", "sdfq"}
  15. def test_inbound_work_orders_all_void_requires_at_least_one():
  16. assert inbound_work_orders_all_void([]) is False
  17. assert inbound_work_orders_all_void([""]) is False
  18. assert inbound_work_orders_all_void([" "]) is False
  19. def test_inbound_work_orders_all_void_true_when_every_status_is_yzf():
  20. assert inbound_work_orders_all_void(["yzf"]) is True
  21. assert inbound_work_orders_all_void(["yzf", "yzf"]) is True
  22. assert inbound_work_orders_all_void([" YZF ", "yzf"]) is True
  23. def test_inbound_work_orders_all_void_false_when_any_non_void():
  24. assert inbound_work_orders_all_void(["yzf", "ywc"]) is False
  25. assert inbound_work_orders_all_void(["dpz"]) is False
  26. assert inbound_work_orders_all_void(["ywc"]) is False
  27. assert inbound_work_orders_all_void(["yzf", ""]) is False