diff --git a/capellambse_context_diagrams/__init__.py b/capellambse_context_diagrams/__init__.py index 47cfd7e7..65e23337 100644 --- a/capellambse_context_diagrams/__init__.py +++ b/capellambse_context_diagrams/__init__.py @@ -122,7 +122,6 @@ def register_classes() -> None: DiagramType.PAB, { "display_parent_relation": True, - "render_styles": styling.BLUE_ACTOR_FNCS, }, ), ( @@ -130,7 +129,6 @@ def register_classes() -> None: DiagramType.PAB, { "display_parent_relation": True, - "render_styles": styling.BLUE_ACTOR_FNCS, }, ), ] diff --git a/capellambse_context_diagrams/collectors/default.py b/capellambse_context_diagrams/collectors/default.py index b918209c..2fd54fda 100644 --- a/capellambse_context_diagrams/collectors/default.py +++ b/capellambse_context_diagrams/collectors/default.py @@ -218,8 +218,14 @@ def port_exchange_collector( edges: dict[str, common.ElementList[fa.AbstractExchange]] = {} for i in ports: try: - if edge := filter(getattr(i, "exchanges")): - edges[i.uuid] = edge + if exs := filter(getattr(i, "exchanges")): + edges[i.uuid] = exs + continue + except AttributeError: + pass + try: + if links := filter(getattr(i, "links")): + edges[i.uuid] = links except AttributeError: pass return edges diff --git a/tests/test_context_diagrams.py b/tests/test_context_diagrams.py index 14d1613c..4f386740 100644 --- a/tests/test_context_diagrams.py +++ b/tests/test_context_diagrams.py @@ -23,7 +23,6 @@ "f0bc11ba-89aa-4297-98d2-076440e9117f", } TEST_DERIVED_UUID = "dbd99773-efb6-4476-bf5c-270a61f18b09" -TEST_PHYSICAL_UUID = "fdb34c92-7c49-491d-bf11-dd139930786e" @pytest.mark.parametrize( @@ -187,9 +186,24 @@ def test_context_diagram_with_derived_interfaces( assert len(derived_diagram) > 5 -def test_context_diagram_of_physical_component( - model: capellambse.MelodyModel, +@pytest.mark.parametrize( + "uuid", + [ + pytest.param( + "fdb34c92-7c49-491d-bf11-dd139930786e", id="PhysicalNodeComponent" + ), + pytest.param( + "313f48f4-fb7e-47a8-b28a-76440932fcb9", + id="PhysicalBehaviorComponent", + ), + ], +) +def test_context_diagram_of_physical_node_component( + model: capellambse.MelodyModel, uuid: str ) -> None: - obj = model.by_uuid(TEST_PHYSICAL_UUID) + obj = model.by_uuid(uuid) + + diag = obj.context_diagram + diag.render("svgdiagram").save(pretty=True) - diag = obj.context_diagram.render("svgdiagram").save(pretty=True) + assert len(diag.nodes) > 1