diff --git a/chk/__main__.py b/chk/__main__.py index b2c9f685..f7807b14 100644 --- a/chk/__main__.py +++ b/chk/__main__.py @@ -1,6 +1,7 @@ """ chk cli """ + from chk.console.main import chk if __name__ == "__main__": diff --git a/chk/infrastructure/helper.py b/chk/infrastructure/helper.py index d47ef8b4..562eea74 100644 --- a/chk/infrastructure/helper.py +++ b/chk/infrastructure/helper.py @@ -171,10 +171,8 @@ def try_dict(to_dict: Any, say_exception: bool = False) -> dict | Any: def formatter( - message: object, - cb: Callable = str, - dump: bool = True, - is_err: bool = False) -> str: + message: object, cb: Callable = str, dump: bool = True, is_err: bool = False +) -> str: """Format message with given callback Args: diff --git a/chk/infrastructure/logging.py b/chk/infrastructure/logging.py index 74add93a..b04aa9e1 100644 --- a/chk/infrastructure/logging.py +++ b/chk/infrastructure/logging.py @@ -21,10 +21,9 @@ class LoggingManager: """LoggingManager""" - cache_dir = '.chkware_cache/' - loggin_dir = 'logs/' - loggin_ext = '.log' - + cache_dir = ".chkware_cache/" + loggin_dir = "logs/" + loggin_ext = ".log" @classmethod def create_cache_dir(cls) -> Path: @@ -43,7 +42,6 @@ def create_cache_dir(cls) -> Path: return cache_path - @classmethod def create_log_dir(cls, parent: Path) -> Path: """create_cache_dir""" @@ -57,12 +55,11 @@ def create_log_dir(cls, parent: Path) -> Path: return log_dir - @classmethod def create_new_log_file(cls) -> Path: """create new log file""" - cache_dir =cls.create_cache_dir() + cache_dir = cls.create_cache_dir() log_dir = cls.create_log_dir(cache_dir) log_file = log_dir / create_session_id() @@ -84,7 +81,6 @@ def remove_loguru(cls) -> None: logger.remove() - def create_session_id() -> str: """create_session_id""" diff --git a/chk/infrastructure/symbol_table.py b/chk/infrastructure/symbol_table.py index a4aa79b1..a86b97f0 100644 --- a/chk/infrastructure/symbol_table.py +++ b/chk/infrastructure/symbol_table.py @@ -1,6 +1,7 @@ """ Symbol and variable management """ + from __future__ import annotations import copy @@ -108,10 +109,10 @@ class VariableTableManager: @classmethod def handle( - cls, - variable_doc: Variables, - document: VersionedDocument | VersionedDocumentV2, - exec_ctx: ExecuteContext, + cls, + variable_doc: Variables, + document: VersionedDocument | VersionedDocumentV2, + exec_ctx: ExecuteContext, ) -> None: """Handles variable handling @@ -151,10 +152,10 @@ def handle_absolute(cls, variable_doc: Variables, document: dict) -> None: @classmethod def handle_composite( - cls, - variable_doc: Variables, - document: dict, - replace_callback: Callable = replace_value, + cls, + variable_doc: Variables, + document: dict, + replace_callback: Callable = replace_value, ) -> None: """Handles absolute variables and values from document @@ -178,7 +179,7 @@ def handle_composite( @classmethod def handle_execute_context( - cls, variable_doc: Variables, exec_ctx: ExecuteContext + cls, variable_doc: Variables, exec_ctx: ExecuteContext ) -> None: """Handle variables passed from external context @@ -220,9 +221,9 @@ def get_expose_doc(document: dict) -> list: @staticmethod def replace_values( - expose_doc: list, - values: dict, - replace_callback: Callable = replace_value, + expose_doc: list, + values: dict, + replace_callback: Callable = replace_value, ) -> list: """Replace values on expose document diff --git a/chk/infrastructure/view.py b/chk/infrastructure/view.py index 14c81ac6..7db4d6b2 100644 --- a/chk/infrastructure/view.py +++ b/chk/infrastructure/view.py @@ -63,7 +63,10 @@ def display( else: formatter(wfp.dump_json(), dump=exec_ctx.options["dump"]) -def die_with_error(err: Exception, Presenter: type[PresentationBuilder], is_fmt: bool) -> None: + +def die_with_error( + err: Exception, Presenter: type[PresentationBuilder], is_fmt: bool +) -> None: """die_with_error""" prs = Presenter(data=None) diff --git a/chk/modules/fetch/__init__.py b/chk/modules/fetch/__init__.py index 3e80c043..b7d16315 100644 --- a/chk/modules/fetch/__init__.py +++ b/chk/modules/fetch/__init__.py @@ -1,6 +1,7 @@ """ Fetch module """ + import sys from collections import abc diff --git a/chk/modules/fetch/services.py b/chk/modules/fetch/services.py index 5fced4f2..3739354c 100644 --- a/chk/modules/fetch/services.py +++ b/chk/modules/fetch/services.py @@ -17,7 +17,7 @@ EXPOSE_SCHEMA as EXP_SCHEMA, VARIABLE_SCHEMA as VAR_SCHEMA, Variables, - replace_value + replace_value, ) from chk.infrastructure.version import ( DocumentVersionMaker, @@ -27,9 +27,12 @@ from chk.modules.fetch.entities import ( ApiResponseModel, BearerAuthentication, - CTYPE_XML, HttpDocument, + CTYPE_XML, + HttpDocument, HttpMethod, - RequestConfigNode, SCHEMA, VERSION_SCOPE, + RequestConfigNode, + SCHEMA, + VERSION_SCOPE, ) diff --git a/chk/modules/validate/__init__.py b/chk/modules/validate/__init__.py index 60e35d70..59c2971c 100644 --- a/chk/modules/validate/__init__.py +++ b/chk/modules/validate/__init__.py @@ -226,7 +226,6 @@ def call(file_ctx: FileContext, exec_ctx: ExecuteContext) -> ExecResponse: validate_doc = ValidationDocument() try: - validate_doc = ValidationDocument.from_file_context(file_ctx) debug(validate_doc.model_dump_json()) diff --git a/chk/modules/validate/assertion_function.py b/chk/modules/validate/assertion_function.py index 58852bd7..d103d03d 100644 --- a/chk/modules/validate/assertion_function.py +++ b/chk/modules/validate/assertion_function.py @@ -1,6 +1,7 @@ """ Assertion Functions mod """ + import datetime import types from typing import TypeAlias, Union diff --git a/chk/modules/validate/entities.py b/chk/modules/validate/entities.py index 8a7ed82d..94e1e1b9 100644 --- a/chk/modules/validate/entities.py +++ b/chk/modules/validate/entities.py @@ -32,11 +32,13 @@ def __iter__(self) -> Generator: yield "msg_pass", self.msg_pass yield "msg_fail", self.msg_fail yield "cast_actual_to", self.cast_actual_to - yield "actual_given", ( - "" if self.actual_given == NotImplemented else self.actual_given + yield ( + "actual_given", + ("" if self.actual_given == NotImplemented else self.actual_given), ) - yield "actual_b4_cast", ( - "" if self.actual_b4_cast == NotImplemented else self.actual_b4_cast + yield ( + "actual_b4_cast", + ("" if self.actual_b4_cast == NotImplemented else self.actual_b4_cast), ) yield "extra_fields", self.extra_fields diff --git a/chk/modules/workflow/services.py b/chk/modules/workflow/services.py index e6e379e5..069c0c72 100644 --- a/chk/modules/workflow/services.py +++ b/chk/modules/workflow/services.py @@ -97,7 +97,6 @@ def _prepare_dump_data(self) -> dict: "exception": repr(item.exception), } if item.task.uses == "fetch": - response_task_dump["fetch_request_method"] = ( item.others["request_method"] if "request_method" in item.others