Fix create_entity for a schema without property rows; test tuple coercion

The Python unit test's fake host omits the properties list the real host
always supplies. The coercion tolerates its absence, and a new test covers
tuples for point properties and lists of them. The previous commit slipped
past the Python tests because the gate did not include them.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Felix RiestraandClaude Sonnet 5 committed 2026-09-20 17:38:31 +02:00
1 parent c731d3a9a4
commit 918351f264
2 files changed
+15 -1

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ def _coerce_points(kind, properties):
"""Let create_entity take (x, y, z) tuples for point properties, as
transaction edits already do, by using the property types in the schema."""
schema = ocs.entity_coverage(kind)
types = {row["name"]: row for row in schema["properties"]} if schema else {}
types = {row["name"]: row for row in schema.get("properties", [])} if schema else {}
result = {}
for name, value in properties.items():
row = types.get(name)