Skip to content
Snippets Groups Projects
Commit 1e51376f authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Eliminated var assignments inside assertion statement

parent 772c7505
No related branches found
No related tags found
1 merge request!252Update to Ubuntu24.04
...@@ -43,7 +43,8 @@ class Executable: ...@@ -43,7 +43,8 @@ class Executable:
def get_version(self) -> dict[str, Any]: def get_version(self) -> dict[str, Any]:
assert self.executable_name == "hived", "version can only be checked for hived binary!" assert self.executable_name == "hived", "version can only be checked for hived binary!"
assert isinstance(result := json.loads(self.__run_and_get_output("--version")), dict) result = json.loads(self.__run_and_get_output("--version"))
assert isinstance(result, dict)
return result return result
def __run_and_get_output(self, *arguments: str) -> str: def __run_and_get_output(self, *arguments: str) -> str:
......
...@@ -115,7 +115,8 @@ class Node(BaseNode, ScopedObject): ...@@ -115,7 +115,8 @@ class Node(BaseNode, ScopedObject):
@property @property
def http_endpoint(self) -> HttpUrl: def http_endpoint(self) -> HttpUrl:
assert (endpoint := self.__notifications.handler.http_endpoint) is not None endpoint = self.__notifications.handler.http_endpoint
assert endpoint is not None
return endpoint return endpoint
@http_endpoint.setter @http_endpoint.setter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment