v0.5.5: compare v2 fix — None→'' спец-кейсы, свежий YAML из терраформа

This commit is contained in:
2026-08-02 07:57:03 +04:00
parent 73ebbf0722
commit b5ecf1dff3
2 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ SERVICES = _DF["SERVICES"]
OPS_INDEX = _DF["OPS_INDEX"]
DELAY = float(os.getenv("MOCK_OP_DELAY", "0.1"))
VERSION = "0.5.4"
VERSION = "0.5.5"
def get_services(stand_id):
+8 -3
View File
@@ -60,11 +60,16 @@ def _cmp_val(rv, pv, field):
"""
rv_norm = _norm(rv)
# Спец-кейс dataType: real=None, poly="string" → 🟢 BETTER
if field == "dataType" and rv_norm is None and pv == "string":
# 🟢 BETTER: real API возвращает null, полигон — осмысленный дефолт
if rv_norm is None:
if field == "dataType" and pv == "string":
return "better"
if field == "defaultValue" and pv == "":
return "better"
if field == "isModifiable" and pv in ("False", "True"):
return "better"
# HTML entities в real → 🟢 BETTER
# 🟢 BETTER: HTML entities в real API
if rv_norm != rv and rv_norm == pv:
return "better"