Skip to content

Commit

Permalink
refactor: rebase and minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
micha91 committed Jun 26, 2024
1 parent db2dc43 commit 6e19b6b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 26 deletions.
3 changes: 0 additions & 3 deletions capella2polarion/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ def synchronize(ctx: click.core.Context) -> None:

polarion_worker = pw.CapellaPolarionWorker(
capella_to_polarion_cli.polarion_params,
capella_to_polarion_cli.config,
capella_to_polarion_cli.force_update,
type_prefix=capella_to_polarion_cli.type_prefix,
role_prefix=capella_to_polarion_cli.role_prefix,
)

polarion_worker.load_polarion_work_item_map()
Expand Down
10 changes: 1 addition & 9 deletions capella2polarion/connectors/polarion_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,11 @@ class CapellaPolarionWorker:
"""CapellaPolarionWorker encapsulate the Polarion API Client work."""

def __init__(
self,
params: PolarionWorkerParams,
config: converter_config.ConverterConfig,
force_update: bool = False,
type_prefix: str = "",
role_prefix: str = "",
self, params: PolarionWorkerParams, force_update: bool = False
) -> None:
self.polarion_params = params
self.polarion_data_repo = polarion_repo.PolarionDataRepository()
self.config = config
self.force_update = force_update
self.type_prefix = type_prefix
self.role_prefix = role_prefix

if (self.polarion_params.project_id is None) or (
len(self.polarion_params.project_id) == 0
Expand Down
4 changes: 1 addition & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ def write(self, text: str):
),
}

pw = polarion_worker.CapellaPolarionWorker(
c2p_cli.polarion_params, c2p_cli.config
)
pw = polarion_worker.CapellaPolarionWorker(c2p_cli.polarion_params)
pw.polarion_data_repo = polarion_repo.PolarionDataRepository([work_item])
return BaseObjectContainer(c2p_cli, pw, mc)
10 changes: 1 addition & 9 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,7 @@ def write(self, text: str):
)
}

pw = polarion_worker.CapellaPolarionWorker(
c2p_cli.polarion_params, c2p_cli.config
)
pw = polarion_worker.CapellaPolarionWorker(c2p_cli.polarion_params)

pw.polarion_data_repo = polarion_repo.PolarionDataRepository(
[work_item]
Expand Down Expand Up @@ -745,9 +743,6 @@ def test_update_work_items(
"get_all_work_items",
polarion_api_get_all_work_items,
)
config = mock.Mock(converter_config.ConverterConfig)
config.polarion_types = set()
base_object.pw.config = config

base_object.pw.load_polarion_work_item_map()

Expand Down Expand Up @@ -812,9 +807,6 @@ def test_update_deleted_work_item(
"get_all_work_items",
polarion_api_get_all_work_items,
)
config = mock.Mock(converter_config.ConverterConfig)
config.polarion_types = set()
base_object.pw.config = config

base_object.pw.load_polarion_work_item_map()

Expand Down
3 changes: 1 addition & 2 deletions tests/test_workitem_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ def worker(monkeypatch: pytest.MonkeyPatch):
"http://localhost",
"TESTPAT",
False,
),
config,
)
)


Expand Down

0 comments on commit 6e19b6b

Please sign in to comment.