Skip to content

Commit

Permalink
ci: fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
micha91 committed Jul 15, 2024
1 parent a9698b1 commit 1ad0dc3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion capella2polarion/connectors/polarion_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from capella2polarion import data_models
from capella2polarion.connectors import polarion_repo
from capella2polarion.converters import converter_config, data_session
from capella2polarion.converters import data_session

logger = logging.getLogger(__name__)

Expand Down
10 changes: 3 additions & 7 deletions capella2polarion/converters/link_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
import capella2polarion.converters.polarion_html_helper
from capella2polarion import data_models
from capella2polarion.connectors import polarion_repo
from capella2polarion.converters import (
converter_config,
data_session,
element_converter,
)
from capella2polarion.converters import converter_config, data_session

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -360,7 +356,7 @@ def _group_by(
def _make_url_list(link_map: dict[str, dict[str, list[str]]]) -> str:
urls: list[str] = []
for link_id in sorted(link_map):
url = capella2polarion.converters.polarion_html_helper.POLARION_WORK_ITEM_URL.format(
url = capella2polarion.converters.polarion_html_helper.POLARION_WORK_ITEM_URL.format( # pylint: disable=line-too-long
pid=link_id
)
urls.append(f"<li>{url}</li>")
Expand All @@ -379,7 +375,7 @@ def _sorted_unordered_html_list(
) -> str:
urls: list[str] = []
for pid in work_item_ids:
url = capella2polarion.converters.polarion_html_helper.POLARION_WORK_ITEM_URL.format(
url = capella2polarion.converters.polarion_html_helper.POLARION_WORK_ITEM_URL.format( # pylint: disable=line-too-long
pid=pid
)
urls.append(f"<li>{url}</li>")
Expand Down
1 change: 0 additions & 1 deletion capella2polarion/converters/polarion_html_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,3 @@ def check_model_element(

def setup_env(self, env: jinja2.Environment):
"""Implement this method to adjust a newly created environment."""
pass
13 changes: 9 additions & 4 deletions tests/test_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_create_new_document(

content = html.fromstring(new_doc.home_page_content.value)

assert len(wis) == 0
assert new_doc.rendering_layouts == [
polarion_api.RenderingLayout(
label="Class", type="class", layouter="section"
Expand All @@ -57,14 +58,16 @@ def test_create_new_document(
etree.tostring(content[2])
.decode("utf-8")
.startswith(
'<div id="polarion_wiki macro name=module-workitem;params=id=ATSY-1234|layout=0|external=true"/>'
'<div id="polarion_wiki macro name=module-workitem;'
'params=id=ATSY-1234|layout=0|external=true"/>'
)
)
assert (
etree.tostring(content[3])
.decode("utf-8")
.startswith(
'<div id="polarion_wiki macro name=module-workitem;params=id=ATSY-4321|layout=0|external=true"/>'
'<div id="polarion_wiki macro name=module-workitem;'
'params=id=ATSY-4321|layout=0|external=true"/>'
)
)

Expand Down Expand Up @@ -105,7 +108,8 @@ def test_update_document(
],
home_page_content=polarion_api.TextContent(
type="text/html",
value='<h2 id="polarion_wiki macro name=module-workitem;params=id=ATSY-16062"/>',
value='<h2 id="polarion_wiki macro name='
'module-workitem;params=id=ATSY-16062"/>',
),
)

Expand All @@ -124,7 +128,8 @@ def test_update_document(
etree.tostring(content[0])
.decode("utf-8")
.startswith(
'<h1 id="polarion_wiki macro name=module-workitem;params=id=ATSY-16062"'
'<h1 id="polarion_wiki macro name='
'module-workitem;params=id=ATSY-16062"'
)
)
assert (
Expand Down
1 change: 0 additions & 1 deletion tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
FakeModelObject,
)

# pylint: disable=redefined-outer-name
TEST_DIAG_UUID = "_APOQ0QPhEeynfbzU12yy7w"
TEST_ELEMENT_UUID = "0d2edb8f-fa34-4e73-89ec-fb9a63001440"
TEST_OCAP_UUID = "83d1334f-6180-46c4-a80d-6839341df688"
Expand Down

0 comments on commit 1ad0dc3

Please sign in to comment.