bugfix: search engine
This commit is contained in:
@@ -70,3 +70,25 @@ def test_correct_subject_is_preserved():
|
||||
assert result is not None
|
||||
assert result["subject"] == "TIM CTRL Redes Sociais 8.0"
|
||||
assert args.get("_subject_corrected_from") is None
|
||||
|
||||
|
||||
def test_cancel_preflight_exact_plan_is_out_of_scope_and_never_rebound_to_vas():
|
||||
args = _args(subject="TIM CTRL Redes Sociais 8.0")
|
||||
result = _preflight_subject("cancelar_vas_avulso", args)
|
||||
assert result is not None
|
||||
assert result["status"] == "OUT_OF_SCOPE"
|
||||
assert args["subject"] == "TIM CTRL Redes Sociais 8.0"
|
||||
assert "TIM Fashion" not in str(result)
|
||||
|
||||
|
||||
def test_invoice_resolver_exact_plan_identity_wins_before_similarity_matcher():
|
||||
from app.domain.contas.invoice_resolver import InvoiceResolver
|
||||
from app.domain.contas.item_matcher import SimilarityItemMatcher
|
||||
|
||||
detail = _args(subject="TIM CTRL Redes Sociais 8.0")["billing_analysis"]
|
||||
outcome = InvoiceResolver(matcher=SimilarityItemMatcher()).resolve(
|
||||
["TIM CTRL Redes Sociais 8.0"], detail
|
||||
)
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user