Skip to content

Commit

Permalink
merge: Merge pull request #92 from DSD-DBS/fix-link-generation
Browse files Browse the repository at this point in the history
Fix link generation
  • Loading branch information
micha91 authored Aug 8, 2024
2 parents e39f922 + cb3f7c7 commit 70b3167
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions capella2polarion/converters/link_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ def _resolve_attribute(
) -> common.ElementList[common.GenericElement] | common.GenericElement:
attr_name, _, map_id = attr_id.partition(".")
objs = getattr(obj, attr_name)
if isinstance(objs, common.GenericElement):
return _resolve_attribute(objs, map_id)
if map_id:
if isinstance(objs, common.GenericElement):
return _resolve_attribute(objs, map_id)
objs = objs.map(map_id)
return objs
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def dummy_work_items() -> dict[str, data_models.CapellaWorkItem]:
}


class FakeModelObject:
class FakeModelObject(mock.MagicMock):
"""Mimicks a capellambse model objectyping."""

def __init__(
Expand All @@ -77,6 +77,7 @@ def __init__(
name: str = "",
attribute: t.Any | None = None,
):
super().__init__(spec=capellambse.model.GenericElement)
self.uuid = uuid
self.name = name
self.attribute = attribute
Expand Down

0 comments on commit 70b3167

Please sign in to comment.