Skip to content

Commit

Permalink
feat: Upgrade polarion-rest-api-client to v0.4.0`
Browse files Browse the repository at this point in the history
Pull request #67 from DSD-DBS/fix-ci-and-upgrade-api-client
  • Loading branch information
ewuerger authored Jun 24, 2024
2 parents da10ed6 + cb7a097 commit 40048db
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ jobs:
git config --global --add url."https://${{ secrets.PAT_GITHUB }}@github".insteadOf https://github
- name: Pre-install private Github dependencies
run: |-
python -m pip install git+https://github.com/DSD-DBS/polarion-rest-api-client.git@v0.3.2
python -m pip install git+https://github.com/DSD-DBS/polarion-rest-api-client.git@v0.4.0
- name: Install test dependencies
run: |-
python -m pip install '.[test]'
- name: Run unit tests
run: |-
python -m pytest --cov-report=term --cov=capella2polarion --rootdir=.
# publish:
# name: Publish artifacts
# runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
python -m pip install pylint
- name: Run pylint
run: |-
pylint -dfixme capella2polarion || exit $(($? & ~24))
pylint -dfixme capella2polarion tests || exit $(($? & ~24))
2 changes: 1 addition & 1 deletion capella2polarion/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def calculate_checksum(self) -> str:
data = dict(sorted(data.items()))

converted = json.dumps(data).encode("utf8")
# pylint: disable-next=attribute-defined-outside-init
# pylint: disable=attribute-defined-outside-init
self._checksum = json.dumps(
{"__C2P__WORK_ITEM": hashlib.sha256(converted).hexdigest()}
| dict(sorted(attachment_checksums.items()))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"capellambse_context_diagrams",
"click",
"PyYAML",
"polarion-rest-api-client==0.3.2",
"polarion-rest-api-client==0.4.0",
"bidict",
"cairosvg",
]
Expand Down
2 changes: 2 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: Apache-2.0
6 changes: 5 additions & 1 deletion tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,7 @@ def test_grouped_links_attributes_with_includes(
work_items = converter.generate_work_items(
base_object.pw.polarion_data_repo
)
work_item: data_models.CapellaWorkItem | None
for i, work_item in enumerate(work_items.values()):
work_item.id = f"WI-{i}"

Expand Down Expand Up @@ -1466,7 +1467,10 @@ def test_diagram(model: capellambse.MelodyModel):
"additional_attributes": {
"preCondition": {
"type": "text/html",
"value": '<div style="text-align: center;">hehe<br/></div>',
"value": (
'<div style="text-align: center;">hehe'
"<br/></div>"
),
},
"postCondition": {
"type": "text/html",
Expand Down

0 comments on commit 40048db

Please sign in to comment.