24 lines
774 B
Python
24 lines
774 B
Python
# Copyright (c) 2025 Patrick Motsch
|
|
"""Port type catalog: nested provenance schemas (Typed Generic Handover)."""
|
|
|
|
from modules.features.graphicalEditor.portTypes import PORT_TYPE_CATALOG, _defaultForType
|
|
|
|
|
|
def test_connection_ref_in_catalog():
|
|
s = PORT_TYPE_CATALOG["ConnectionRef"]
|
|
names = {f.name for f in s.fields}
|
|
assert names == {"id", "authority", "label"}
|
|
|
|
|
|
def test_document_list_has_provenance_fields():
|
|
s = PORT_TYPE_CATALOG["DocumentList"]
|
|
names = {f.name for f in s.fields}
|
|
assert "documents" in names
|
|
assert "connection" in names
|
|
assert "source" in names
|
|
assert "count" in names
|
|
|
|
|
|
def test_default_for_nested_schema_type():
|
|
assert _defaultForType("ConnectionRef") == {}
|
|
assert _defaultForType("List[Document]") == []
|