Skip to content

Commit

Permalink
refactor: remove not needed method _save_value_string from PolarionWo…
Browse files Browse the repository at this point in the history
…rker
  • Loading branch information
micha91 committed Jan 11, 2024
1 parent 0a42a2e commit 826c34f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions capella2polarion/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ def __init__(
):
raise ValueError(
f"""ProjectId invalid. Value
'{self._save_value_string(self.polarion_params.project_id)}'"""
'{self.polarion_params.project_id}'"""
)

result_url = parse.urlparse(self.polarion_params.url)
if not all([result_url.scheme, result_url.netloc]):
raise ValueError(
f"""Polarion URL parameter is not a valid url.
Value {self._save_value_string(self.polarion_params.url)}"""
Value {self.polarion_params.url}"""
)
if self.polarion_params.private_access_token is None:
raise ValueError(
Expand All @@ -84,15 +84,12 @@ def __init__(
)
self.check_client()

def _save_value_string(self, value: str | None) -> str | None:
return "None" if value is None else value

def check_client(self) -> None:
"""Instantiate the polarion client as member."""
if not self.client.project_exists():
raise KeyError(
f"Miss Polarion project with id "
f"{self._save_value_string(self.polarion_params.project_id)}"
f"{self.polarion_params.project_id}"
)

def generate_converter_session(
Expand Down

0 comments on commit 826c34f

Please sign in to comment.