Curatare globala a comentariilor si docstring-urilor (app, tools, teste, scripturi): eliminate referintele la PRD-uri, US-xxx, task-uri istorice si review-uri; pastrata doar informatia functionala, formulata scurt. Regula adaugata in CLAUDE.md (sectiunea Stil). Fara modificari de cod sau comportament. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
29 lines
859 B
Python
29 lines
859 B
Python
"""build_key incorporeaza rar_env."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.idempotency import build_key, canonicalize_row
|
|
|
|
|
|
def _canon():
|
|
raw = {
|
|
"vin": "WVWZZZ1JZXW000001", "nr_inmatriculare": "B 123 ABC",
|
|
"data_prestatie": "2026-01-10", "odometru_final": "123456.0",
|
|
"prestatii": [{"cod_prestatie": "OE-1"}],
|
|
}
|
|
canon = canonicalize_row(raw)
|
|
canon["prestatii"] = raw["prestatii"]
|
|
return canon
|
|
|
|
|
|
def test_key_difera_intre_test_si_prod():
|
|
canon = _canon()
|
|
assert build_key(1, canon, "test") != build_key(1, canon, "prod")
|
|
|
|
|
|
def test_key_stabil_pe_env():
|
|
canon = _canon()
|
|
assert build_key(1, canon, "prod") == build_key(1, canon, "prod")
|
|
# None si 1 colapseaza la aceeasi cheie (account_or_default), pe acelasi env
|
|
assert build_key(None, canon, "test") == build_key(1, canon, "test")
|