Spaces:
Sleeping
Sleeping
| import pytest | |
| from support_ticket_env import parse_action | |
| def test_parse_action_accepts_valid_discriminated_union() -> None: | |
| action = parse_action({"action_type": "search_kb", "query": "password reset"}) | |
| assert action.action_type == "search_kb" | |
| assert action.query == "password reset" | |
| def test_parse_action_rejects_invalid_refund_reason_code() -> None: | |
| with pytest.raises(Exception): | |
| parse_action( | |
| { | |
| "action_type": "issue_refund", | |
| "amount_cents": 4900, | |
| "reason_code": "manual_override", | |
| } | |
| ) | |