From 43f7f4b8521e4c452d0db29968a21119475e14ae Mon Sep 17 00:00:00 2001 From: JeffreyChen <33644111+JE-Chen@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:09:13 +0800 Subject: [PATCH] Update stable and dev version Update stable and dev version * Refactor --- .idea/misc.xml | 3 +++ stable.toml => dev.toml | 11 +++++------ je_load_density/utils/executor/action_executor.py | 4 +--- je_load_density/utils/scheduler/extend_apscheduler.py | 4 ++-- .../xml/change_xml_structure/change_xml_structure.py | 4 +--- pyproject.toml | 11 ++++++----- 6 files changed, 18 insertions(+), 19 deletions(-) rename stable.toml => dev.toml (88%) diff --git a/.idea/misc.xml b/.idea/misc.xml index 37483bb..d1dce60 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ + + \ No newline at end of file diff --git a/stable.toml b/dev.toml similarity index 88% rename from stable.toml rename to dev.toml index dac5230..010ac42 100644 --- a/stable.toml +++ b/dev.toml @@ -1,12 +1,12 @@ -# Rename to stable version -# This is stable version +# Rename to dev version +# This is dev version [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] -name = "je_load_density" -version = "0.0.55" +name = "je_load_density_dev" +version = "0.0.66" authors = [ { name = "JE-Chen", email = "jechenmailman@gmail.com" }, ] @@ -14,8 +14,7 @@ description = "Load & Stress Automation Freamework" requires-python = ">=3.9" license = { text = "MIT" } dependencies = [ - "locust", - "APScheduler", + "locust", "APScheduler", ] classifiers = [ "Programming Language :: Python :: 3.9", diff --git a/je_load_density/utils/executor/action_executor.py b/je_load_density/utils/executor/action_executor.py index ab89f67..b7a8a48 100644 --- a/je_load_density/utils/executor/action_executor.py +++ b/je_load_density/utils/executor/action_executor.py @@ -78,9 +78,7 @@ def execute_action(self, action_list: [list, dict]) -> dict: raise LoadDensityTestExecuteException(executor_list_error) execute_record_dict = dict() try: - if len(action_list) > 0 or isinstance(action_list, list): - pass - else: + if len(action_list) == 0 or isinstance(action_list, list) is False: raise LoadDensityTestExecuteException(executor_list_error) except Exception as error: print(repr(error), file=sys.stderr) diff --git a/je_load_density/utils/scheduler/extend_apscheduler.py b/je_load_density/utils/scheduler/extend_apscheduler.py index 7ed0c98..36abd01 100644 --- a/je_load_density/utils/scheduler/extend_apscheduler.py +++ b/je_load_density/utils/scheduler/extend_apscheduler.py @@ -58,7 +58,7 @@ def add_blocking_job( """ params = locals() params.pop("self") - trigger_args = params.pop("trigger_args") + params.pop("trigger_args") return self._blocking_schedulers.add_job(**params, **trigger_args) def add_nonblocking_job( @@ -92,7 +92,7 @@ def add_nonblocking_job( """ params = locals() params.pop("self") - trigger_args = params.pop("trigger_args") + params.pop("trigger_args") return self._background_schedulers.add_job(**params, **trigger_args) def get_blocking_scheduler(self) -> BlockingScheduler: diff --git a/je_load_density/utils/xml/change_xml_structure/change_xml_structure.py b/je_load_density/utils/xml/change_xml_structure/change_xml_structure.py index 414a8c6..fcb33ab 100644 --- a/je_load_density/utils/xml/change_xml_structure/change_xml_structure.py +++ b/je_load_density/utils/xml/change_xml_structure/change_xml_structure.py @@ -35,9 +35,7 @@ def dict_to_elements_tree(json_dict: dict): """ def _to_elements_tree(json_dict: dict, root): - if not json_dict: - pass - elif isinstance(json_dict, str): + if isinstance(json_dict, str): root.text = json_dict elif isinstance(json_dict, dict): for key, value in json_dict.items(): diff --git a/pyproject.toml b/pyproject.toml index aefa90c..2c6ca7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ -# Rename to dev version -# This is dev version +# Rename to stable version +# This is stable version [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] -name = "je_load_density_dev" -version = "0.0.65" +name = "je_load_density" +version = "0.0.56" authors = [ { name = "JE-Chen", email = "jechenmailman@gmail.com" }, ] @@ -14,7 +14,8 @@ description = "Load & Stress Automation Freamework" requires-python = ">=3.9" license = { text = "MIT" } dependencies = [ - "locust", "APScheduler", + "locust", + "APScheduler", ] classifiers = [ "Programming Language :: Python :: 3.9",