Skip to content

Commit

Permalink
fix: Test log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Jun 25, 2024
1 parent 080586a commit 5da0328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion capella2polarion/converters/link_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def create_links_for_work_item(
self._create(work_item.id, role_id, new, {})
)
except Exception as error:
link_errors.add(error.args[0])
link_errors.add(error.args[0] if error.args else str(error))

if link_errors:
converter_data.errors |= link_errors
Expand Down
4 changes: 2 additions & 2 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def test_create_links_no_new_links_with_errors(
):
expected = (
"Link creation for \"<FakeModelObject 'Fake 2' (uuid2)>\" failed:"
"\n\tassert False"
"\n\tNo"
)

work_item_obj_2 = data_models.CapellaWorkItem(
Expand Down Expand Up @@ -502,7 +502,7 @@ def test_create_links_no_new_links_with_errors(
)

def error():
assert False
raise ValueError("No")

link_serializer.serializers["invalid_role"] = (
lambda obj, work_item_id, role_id, attr_id, links: error()
Expand Down

0 comments on commit 5da0328

Please sign in to comment.