Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Only use prefix options when variable is set #74

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci-templates/gitlab/synchronise_elements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ capella2polarion_synchronise_elements:
--polarion-project-id=${CAPELLA2POLARION_PROJECT_ID:?} \
--capella-model="${CAPELLA2POLARION_MODEL_JSON:?}" \
--synchronize-config=${CAPELLA2POLARION_CONFIG:?} \
--type-prefix="${CAPELLA2POLARION_TYPE_PREFIX:?}" \
--role-prefix="${CAPELLA2POLARION_ROLE_PREFIX:?}" \
${CAPELLA2POLARION_TYPE_PREFIX:+--type-prefix="$CAPELLA2POLARION_TYPE_PREFIX"} \
${CAPELLA2POLARION_ROLE_PREFIX:+--role-prefix="$CAPELLA2POLARION_ROLE_PREFIX"} \
synchronize
10 changes: 4 additions & 6 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,7 @@ def test_create_links_no_new_links_with_errors(
expected = (
"Link creation for \"<FakeModelObject 'Fake 2' (uuid2)>\" failed:"
"\n\tRequested attribute: non_existent_attr"
"\n\tAssertionError assert False"
"\n\t--------"
"\n\t"
)

work_item_obj_2 = data_models.CapellaWorkItem(
Expand Down Expand Up @@ -517,7 +516,7 @@ def error():

assert not links
assert len(caplog.messages) == 1
assert caplog.messages[0] == expected
assert caplog.messages[0].startswith(expected)
assert len(base_object.mc.converter_session["uuid2"].errors) == 3

@staticmethod
Expand All @@ -528,8 +527,7 @@ def test_create_links_with_new_links_and_errors(
"Link creation for \"<FakeModelObject 'Fake 2' (uuid2)>\" "
"partially successful. Some links were not created:"
"\n\tRequested attribute: non_existent_attr"
"\n\tAssertionError assert False"
"\n\t--------"
"\n\t"
)

work_item_obj_2 = data_models.CapellaWorkItem(
Expand Down Expand Up @@ -594,7 +592,7 @@ def error():

assert links == [expected_link]
assert len(caplog.messages) == 1
assert caplog.messages[0] == expected
assert caplog.messages[0].startswith(expected)

@staticmethod
def test_create_links_from_ElementList(base_object: BaseObjectContainer):
Expand Down
Loading