fix(1c): separate template descriptor type from payload carrier
This commit is contained in:
@@ -280,6 +280,7 @@ def test_appearance_inspect_resolves_public_common_template(monkeypatch: pytest.
|
||||
assert result["status"] == "ok"
|
||||
assert result["template"]["name"] == "Оформление"
|
||||
assert result["appearance"]["items"][0]["parameter"] == "Заголовок"
|
||||
assert result["template_type"]["status"] == "unresolved"
|
||||
|
||||
|
||||
def test_report_inspect_keeps_forms_separate_from_scd(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
@@ -7009,9 +7010,40 @@ def test_public_template_summary_recognizes_live_appearance_xml_root() -> None:
|
||||
[{"role": "content", "classification": {"xml_root": "AppearanceTemplate"}, "features": {}}]
|
||||
)
|
||||
|
||||
assert summary["platform_type"] == "Макет оформления компоновки данных"
|
||||
assert summary["template_type_candidates"][0]["id"] == "data_composition_appearance_template"
|
||||
assert summary["template_type_candidates"][0]["evidence"] == ["payload XML root"]
|
||||
assert summary["platform_type"] == "Двоичные данные"
|
||||
assert summary["template_type_candidates"][0]["id"] == "binary_data"
|
||||
assert summary["content_type_evidence"] == {
|
||||
"xml_roots": ["AppearanceTemplate"],
|
||||
"meaning": "payload_carrier_only_not_platform_template_type",
|
||||
}
|
||||
|
||||
|
||||
def test_public_template_summary_exposes_unmapped_descriptor_type_code() -> None:
|
||||
summary = adapter_server.public_template_summary(
|
||||
[
|
||||
{
|
||||
"role": "metadata_payload",
|
||||
"classification": {
|
||||
"tree": {
|
||||
"type": "list",
|
||||
"items": [
|
||||
{"type": "atom", "value": "1"},
|
||||
{"type": "list", "items": [
|
||||
{"type": "atom", "value": "4"},
|
||||
{"type": "list", "items": []},
|
||||
{"type": "atom", "value": "7"},
|
||||
]},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{"role": "content", "classification": {"xml_root": "AppearanceTemplate"}, "features": {}},
|
||||
]
|
||||
)
|
||||
|
||||
assert summary["platform_type"] == "Двоичные данные"
|
||||
assert summary["descriptor_type_evidence"]["codes"] == ["7"]
|
||||
assert summary["descriptor_type_evidence"]["status"] == "unresolved_mapping"
|
||||
|
||||
|
||||
def test_common_template_inventory_uses_parts_classifier(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
@@ -7021,7 +7053,8 @@ def test_common_template_inventory_uses_parts_classifier(monkeypatch: pytest.Mon
|
||||
|
||||
result = adapter_server.metadata_object_templates({"base_id": "upo_test", "kind": "CommonTemplate", "name": "Оформление"})
|
||||
|
||||
assert result["templates"][0]["platform_type"] == "Макет оформления компоновки данных"
|
||||
assert result["templates"][0]["platform_type"] == "Двоичные данные"
|
||||
assert result["templates"][0]["content_type_evidence"]["xml_roots"] == ["AppearanceTemplate"]
|
||||
assert result["templates"][0]["name"] == "Оформление"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user