bugfix: oci_openai provider
This commit is contained in:
@@ -92,3 +92,40 @@ def test_invoice_resolver_exact_plan_identity_wins_before_similarity_matcher():
|
||||
assert outcome.resolved == []
|
||||
assert len(outcome.out_of_scope) == 1
|
||||
assert outcome.out_of_scope[0].matches[0].canonical_name == "TIM CTRL Redes Sociais 8.0"
|
||||
|
||||
|
||||
def test_recovers_explicit_subject_from_runtime_query_fields_without_motivo():
|
||||
args = _args(subject="TIM CTRL Redes Sociais")
|
||||
args.pop("motivo", None)
|
||||
args["query"] = "nao contratei TIM CTRL Redes Sociais 8.0"
|
||||
args["operator_instructions"] = "nao contratei TIM CTRL Redes Sociais 8.0"
|
||||
args["valor"] = 8
|
||||
|
||||
item = _recover_explicit_contestation_subject(args)
|
||||
assert item is not None
|
||||
assert item["name"] == "TIM CTRL Redes Sociais 8.0"
|
||||
assert str(item["value"]) == "71.99"
|
||||
assert item["category"] == "plano"
|
||||
|
||||
result = _preflight_subject("contestar_cobranca", args)
|
||||
assert result is not None
|
||||
assert result["status"] == "OUT_OF_SCOPE"
|
||||
assert result["subject"] == "TIM CTRL Redes Sociais 8.0"
|
||||
assert result["resolved_value"] == "71.99"
|
||||
assert result["metadata"]["subject_corrected_from"] == "TIM CTRL Redes Sociais"
|
||||
assert args["subject"] == "TIM CTRL Redes Sociais 8.0"
|
||||
assert args["resolved_value"] == "71.99"
|
||||
|
||||
|
||||
def test_all_supported_original_text_fields_recover_explicit_subject():
|
||||
for field in ("query", "operator_instructions", "message", "text", "motivo", "descricao"):
|
||||
args = _args(subject="TIM CTRL Redes Sociais")
|
||||
for candidate in ("query", "operator_instructions", "message", "text", "motivo", "descricao"):
|
||||
args.pop(candidate, None)
|
||||
args[field] = "nao contratei TIM CTRL Redes Sociais 8.0"
|
||||
args["valor"] = 8
|
||||
|
||||
item = _recover_explicit_contestation_subject(args)
|
||||
assert item is not None, field
|
||||
assert item["name"] == "TIM CTRL Redes Sociais 8.0", field
|
||||
assert str(item["value"]) == "71.99", field
|
||||
|
||||
Reference in New Issue
Block a user