je-api-testka-dev 0.0.87__tar.gz → 0.0.89__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/PKG-INFO +6 -4
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/README.md +5 -3
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/assert_result/result_check.py +4 -3
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/callback/callback_function_executor.py +3 -25
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/executor/action_executor.py +7 -22
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/generate_report/html_report_generate.py +3 -2
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/generate_report/json_report.py +3 -2
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/generate_report/xml_report.py +4 -2
- je_api_testka_dev-0.0.89/je_api_testka/utils/global_dict/event_dict.py +29 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/json/json_file/json_file.py +2 -2
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/json/json_format/json_process.py +2 -2
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/mock_server/flask_mock_server.py +4 -4
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/package_manager/package_manager_class.py +5 -4
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/socket_server/api_testka_socket_server.py +4 -4
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/test_record/test_record_class.py +1 -1
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/xml/change_xml_structure/change_xml_structure.py +2 -2
- je_api_testka_dev-0.0.89/je_api_testka/utils/xml/xml_file/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka_dev.egg-info/PKG-INFO +6 -4
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka_dev.egg-info/SOURCES.txt +2 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/pyproject.toml +1 -1
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/__main__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/requests_wrapper/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/requests_wrapper/request_method.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/requests_wrapper/requests_http_method_wrapper.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/assert_result/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/callback/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/exception/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/exception/exception_tags.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/exception/exceptions.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/executor/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/file_process/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/file_process/get_dir_file_list.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/generate_report/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/get_data_strcture/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/get_data_strcture/get_api_data.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/json → je_api_testka_dev-0.0.89/je_api_testka/utils/global_dict}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/json/json_file → je_api_testka_dev-0.0.89/je_api_testka/utils/json}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/mock_server → je_api_testka_dev-0.0.89/je_api_testka/utils/json/json_file}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/json/json_format/__init__.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/package_manager → je_api_testka_dev-0.0.89/je_api_testka/utils/mock_server}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/project → je_api_testka_dev-0.0.89/je_api_testka/utils/package_manager}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/project/template → je_api_testka_dev-0.0.89/je_api_testka/utils/project}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/project/create_project_structure.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/socket_server → je_api_testka_dev-0.0.89/je_api_testka/utils/project/template}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/project/template/template_executor.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/project/template/template_keyword.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/test_record → je_api_testka_dev-0.0.89/je_api_testka/utils/socket_server}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/xml → je_api_testka_dev-0.0.89/je_api_testka/utils/test_record}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/xml/change_xml_structure → je_api_testka_dev-0.0.89/je_api_testka/utils/xml}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87/je_api_testka/utils/xml/xml_file → je_api_testka_dev-0.0.89/je_api_testka/utils/xml/change_xml_structure}/__init__.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/xml/xml_file/xml_file.py +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka_dev.egg-info/dependency_links.txt +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka_dev.egg-info/requires.txt +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka_dev.egg-info/top_level.txt +0 -0
- {je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: je_api_testka_dev
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.89
|
|
4
4
|
Summary: Requests Automation Framework
|
|
5
5
|
Author-email: JE-Chen <jechenmailman@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -22,11 +22,13 @@ Description-Content-Type: text/markdown
|
|
|
22
22
|
|
|
23
23
|
[](https://www.codacy.com/gh/JE-Chen/APITestka/dashboard?utm_source=github.com&utm_medium=referral&utm_content=JE-Chen/APITestka&utm_campaign=Badge_Grade)
|
|
24
24
|
|
|
25
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_8.yml)
|
|
26
26
|
|
|
27
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_9.yml)
|
|
28
28
|
|
|
29
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_10.yml)
|
|
30
|
+
|
|
31
|
+
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_11.yml)
|
|
30
32
|
|
|
31
33
|
### Documentation
|
|
32
34
|
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
[](https://www.codacy.com/gh/JE-Chen/APITestka/dashboard?utm_source=github.com&utm_medium=referral&utm_content=JE-Chen/APITestka&utm_campaign=Badge_Grade)
|
|
5
5
|
|
|
6
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_8.yml)
|
|
7
7
|
|
|
8
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_9.yml)
|
|
9
9
|
|
|
10
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_10.yml)
|
|
11
|
+
|
|
12
|
+
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_11.yml)
|
|
11
13
|
|
|
12
14
|
### Documentation
|
|
13
15
|
|
|
@@ -3,7 +3,7 @@ import sys
|
|
|
3
3
|
from je_api_testka.utils.exception.exceptions import APIAssertException
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def check_result(result_dict: dict, result_check_dict: dict):
|
|
6
|
+
def check_result(result_dict: dict, result_check_dict: dict) -> None:
|
|
7
7
|
"""
|
|
8
8
|
:param result_dict: response result dict (get_api_response_data's return data)
|
|
9
9
|
:param result_check_dict: the dict include data name and value to check result_dict is valid or not
|
|
@@ -16,5 +16,6 @@ def check_result(result_dict: dict, result_check_dict: dict):
|
|
|
16
16
|
right_value=value, wrong_value=result_dict.get(key)
|
|
17
17
|
), file=sys.stderr
|
|
18
18
|
)
|
|
19
|
-
raise APIAssertException(
|
|
20
|
-
|
|
19
|
+
raise APIAssertException(
|
|
20
|
+
"value should be {right_value} but value was {wrong_value}".format(
|
|
21
|
+
right_value=value, wrong_value=result_dict.get(key)))
|
|
@@ -1,37 +1,15 @@
|
|
|
1
1
|
import typing
|
|
2
2
|
from sys import stderr
|
|
3
3
|
|
|
4
|
-
from je_api_testka.utils.mock_server.flask_mock_server import flask_mock_server_instance
|
|
5
|
-
from je_api_testka.requests_wrapper.request_method import test_api_method
|
|
6
4
|
from je_api_testka.utils.exception.exception_tags import get_bad_trigger_function, get_bad_trigger_method
|
|
7
5
|
from je_api_testka.utils.exception.exceptions import CallbackExecutorException
|
|
8
|
-
from je_api_testka.utils.
|
|
9
|
-
from je_api_testka.utils.generate_report.html_report_generate import generate_html_report
|
|
10
|
-
from je_api_testka.utils.generate_report.json_report import generate_json
|
|
11
|
-
from je_api_testka.utils.generate_report.json_report import generate_json_report
|
|
12
|
-
from je_api_testka.utils.generate_report.xml_report import generate_xml
|
|
13
|
-
from je_api_testka.utils.generate_report.xml_report import generate_xml_report
|
|
6
|
+
from je_api_testka.utils.global_dict.event_dict import event_dict
|
|
14
7
|
from je_api_testka.utils.package_manager.package_manager_class import package_manager
|
|
15
8
|
|
|
16
9
|
|
|
17
10
|
class CallbackFunctionExecutor(object):
|
|
18
11
|
def __init__(self):
|
|
19
|
-
self.event_dict =
|
|
20
|
-
# Test api
|
|
21
|
-
"test_api_method": test_api_method,
|
|
22
|
-
# Report
|
|
23
|
-
"generate_html": generate_html,
|
|
24
|
-
"generate_html_report": generate_html_report,
|
|
25
|
-
"generate_json": generate_json,
|
|
26
|
-
"generate_json_report": generate_json_report,
|
|
27
|
-
"generate_xml": generate_xml,
|
|
28
|
-
"generate_xml_report": generate_xml_report,
|
|
29
|
-
# Mock
|
|
30
|
-
"flask_mock_server_add_router": flask_mock_server_instance.add_router,
|
|
31
|
-
"start_flask_mock_server": flask_mock_server_instance.start_mock_server,
|
|
32
|
-
# Package manager
|
|
33
|
-
"add_package_to_callback_executor": package_manager.add_package_to_callback_executor,
|
|
34
|
-
}
|
|
12
|
+
self.event_dict = event_dict
|
|
35
13
|
|
|
36
14
|
def callback_function(
|
|
37
15
|
self,
|
|
@@ -40,7 +18,7 @@ class CallbackFunctionExecutor(object):
|
|
|
40
18
|
callback_function_param: [dict, None] = None,
|
|
41
19
|
callback_param_method: [str, None] = "kwargs",
|
|
42
20
|
**kwargs
|
|
43
|
-
):
|
|
21
|
+
) -> typing.Any:
|
|
44
22
|
"""
|
|
45
23
|
:param trigger_function_name: what function we want to trigger only accept function in event_dict
|
|
46
24
|
:param callback_function: what function we want to callback
|
|
@@ -14,6 +14,7 @@ from je_api_testka.utils.generate_report.json_report import generate_json
|
|
|
14
14
|
from je_api_testka.utils.generate_report.json_report import generate_json_report
|
|
15
15
|
from je_api_testka.utils.generate_report.xml_report import generate_xml
|
|
16
16
|
from je_api_testka.utils.generate_report.xml_report import generate_xml_report
|
|
17
|
+
from je_api_testka.utils.global_dict.event_dict import event_dict
|
|
17
18
|
from je_api_testka.utils.json.json_file.json_file import read_action_json
|
|
18
19
|
from je_api_testka.utils.mock_server.flask_mock_server import flask_mock_server_instance
|
|
19
20
|
from je_api_testka.utils.package_manager.package_manager_class import package_manager
|
|
@@ -22,28 +23,12 @@ from je_api_testka.utils.package_manager.package_manager_class import package_ma
|
|
|
22
23
|
class Executor(object):
|
|
23
24
|
|
|
24
25
|
def __init__(self):
|
|
25
|
-
self.event_dict =
|
|
26
|
-
# test api
|
|
27
|
-
"test_api_method": test_api_method,
|
|
28
|
-
"generate_html": generate_html,
|
|
29
|
-
"generate_html_report": generate_html_report,
|
|
30
|
-
"generate_json": generate_json,
|
|
31
|
-
"generate_json_report": generate_json_report,
|
|
32
|
-
"generate_xml": generate_xml,
|
|
33
|
-
"generate_xml_report": generate_xml_report,
|
|
34
|
-
# execute
|
|
35
|
-
"execute_action": self.execute_action,
|
|
36
|
-
"execute_files": self.execute_files,
|
|
37
|
-
"add_package_to_executor": package_manager.add_package_to_executor,
|
|
38
|
-
# mock
|
|
39
|
-
"flask_mock_server_add_router": flask_mock_server_instance.add_router,
|
|
40
|
-
"start_flask_mock_server": flask_mock_server_instance.start_mock_server,
|
|
41
|
-
}
|
|
26
|
+
self.event_dict = event_dict
|
|
42
27
|
# get all builtin function and add to event dict
|
|
43
28
|
for function in getmembers(builtins, isbuiltin):
|
|
44
29
|
self.event_dict.update({str(function[0]): function[1]})
|
|
45
30
|
|
|
46
|
-
def _execute_event(self, action: list):
|
|
31
|
+
def _execute_event(self, action: list) -> typing.Any:
|
|
47
32
|
"""
|
|
48
33
|
:param action: execute action
|
|
49
34
|
:return: what event return
|
|
@@ -94,7 +79,7 @@ class Executor(object):
|
|
|
94
79
|
print(value)
|
|
95
80
|
return execute_record_dict
|
|
96
81
|
|
|
97
|
-
def execute_files(self, execute_files_list: list):
|
|
82
|
+
def execute_files(self, execute_files_list: list) -> typing.List[typing.Any]:
|
|
98
83
|
"""
|
|
99
84
|
:param execute_files_list: list include execute files path
|
|
100
85
|
:return: every execute detail as list
|
|
@@ -109,7 +94,7 @@ executor = Executor()
|
|
|
109
94
|
package_manager.executor = executor
|
|
110
95
|
|
|
111
96
|
|
|
112
|
-
def add_command_to_executor(command_dict: dict):
|
|
97
|
+
def add_command_to_executor(command_dict: dict) -> None:
|
|
113
98
|
for command_name, command in command_dict.items():
|
|
114
99
|
if isinstance(command, (types.MethodType, types.FunctionType)):
|
|
115
100
|
executor.event_dict.update({command_name: command})
|
|
@@ -117,9 +102,9 @@ def add_command_to_executor(command_dict: dict):
|
|
|
117
102
|
raise APIAddCommandException(add_command_exception_tag)
|
|
118
103
|
|
|
119
104
|
|
|
120
|
-
def execute_action(action_list: list):
|
|
105
|
+
def execute_action(action_list: list) -> typing.Any:
|
|
121
106
|
return executor.execute_action(action_list)
|
|
122
107
|
|
|
123
108
|
|
|
124
|
-
def execute_files(execute_files_list: list):
|
|
109
|
+
def execute_files(execute_files_list: list) -> typing.List[typing.Any]:
|
|
125
110
|
return executor.execute_files(execute_files_list)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
import typing
|
|
2
3
|
from threading import Lock
|
|
3
4
|
|
|
4
5
|
from je_api_testka.utils.exception.exception_tags import html_generate_no_data_tag
|
|
@@ -197,7 +198,7 @@ _failure_table = \
|
|
|
197
198
|
""".strip()
|
|
198
199
|
|
|
199
200
|
|
|
200
|
-
def generate_html():
|
|
201
|
+
def generate_html() -> typing.Tuple[list, list]:
|
|
201
202
|
"""
|
|
202
203
|
:return: test success_list & test failure_list
|
|
203
204
|
"""
|
|
@@ -243,7 +244,7 @@ def generate_html():
|
|
|
243
244
|
return success_list, failure_list
|
|
244
245
|
|
|
245
246
|
|
|
246
|
-
def generate_html_report(html_file_name: str = "default_name"):
|
|
247
|
+
def generate_html_report(html_file_name: str = "default_name") -> None:
|
|
247
248
|
"""
|
|
248
249
|
:param html_file_name: save html file name
|
|
249
250
|
:return:
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import sys
|
|
3
|
+
import typing
|
|
3
4
|
from threading import Lock
|
|
4
5
|
|
|
5
6
|
from je_api_testka.utils.test_record.test_record_class import test_record_instance
|
|
@@ -7,7 +8,7 @@ from je_api_testka.utils.exception.exception_tags import cant_save_json_report_r
|
|
|
7
8
|
from je_api_testka.utils.exception.exceptions import APIJsonReportException
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
def generate_json():
|
|
11
|
+
def generate_json() -> typing.Tuple[dict, dict]:
|
|
11
12
|
"""
|
|
12
13
|
:return: test success_dict test failure_dict
|
|
13
14
|
"""
|
|
@@ -63,7 +64,7 @@ def generate_json():
|
|
|
63
64
|
return success_dict, failure_dict
|
|
64
65
|
|
|
65
66
|
|
|
66
|
-
def generate_json_report(json_file_name: str = "default_name"):
|
|
67
|
+
def generate_json_report(json_file_name: str = "default_name") -> None:
|
|
67
68
|
"""
|
|
68
69
|
:param json_file_name: save json file's name
|
|
69
70
|
"""
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
import typing
|
|
2
3
|
from threading import Lock
|
|
3
4
|
from xml.dom.minidom import parseString
|
|
5
|
+
|
|
4
6
|
from je_api_testka.utils.generate_report.json_report import generate_json
|
|
5
7
|
from je_api_testka.utils.xml.change_xml_structure.change_xml_structure import dict_to_elements_tree
|
|
6
8
|
|
|
7
9
|
|
|
8
|
-
def generate_xml():
|
|
10
|
+
def generate_xml() -> typing.Tuple[str, str]:
|
|
9
11
|
"""
|
|
10
12
|
:return: success_xml_string, failure_xml_string
|
|
11
13
|
"""
|
|
@@ -17,7 +19,7 @@ def generate_xml():
|
|
|
17
19
|
return success_json_to_xml, failure_json_to_xml
|
|
18
20
|
|
|
19
21
|
|
|
20
|
-
def generate_xml_report(xml_file_name: str = "default_name"):
|
|
22
|
+
def generate_xml_report(xml_file_name: str = "default_name") -> None:
|
|
21
23
|
"""
|
|
22
24
|
:param xml_file_name: save xml file with xml_file_name
|
|
23
25
|
"""
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from je_api_testka.utils.executor.action_executor import execute_action, execute_files
|
|
2
|
+
|
|
3
|
+
from je_api_testka.requests_wrapper.request_method import test_api_method
|
|
4
|
+
from je_api_testka.utils.generate_report.html_report_generate import generate_html
|
|
5
|
+
from je_api_testka.utils.generate_report.html_report_generate import generate_html_report
|
|
6
|
+
from je_api_testka.utils.generate_report.json_report import generate_json
|
|
7
|
+
from je_api_testka.utils.generate_report.json_report import generate_json_report
|
|
8
|
+
from je_api_testka.utils.generate_report.xml_report import generate_xml
|
|
9
|
+
from je_api_testka.utils.generate_report.xml_report import generate_xml_report
|
|
10
|
+
from je_api_testka.utils.mock_server.flask_mock_server import flask_mock_server_instance
|
|
11
|
+
from je_api_testka.utils.package_manager.package_manager_class import package_manager
|
|
12
|
+
|
|
13
|
+
event_dict = {
|
|
14
|
+
# test api
|
|
15
|
+
"test_api_method": test_api_method,
|
|
16
|
+
"generate_html": generate_html,
|
|
17
|
+
"generate_html_report": generate_html_report,
|
|
18
|
+
"generate_json": generate_json,
|
|
19
|
+
"generate_json_report": generate_json_report,
|
|
20
|
+
"generate_xml": generate_xml,
|
|
21
|
+
"generate_xml_report": generate_xml_report,
|
|
22
|
+
# execute
|
|
23
|
+
"execute_action": execute_action,
|
|
24
|
+
"execute_files": execute_files,
|
|
25
|
+
"add_package_to_executor": package_manager.add_package_to_executor,
|
|
26
|
+
# mock
|
|
27
|
+
"flask_mock_server_add_router": flask_mock_server_instance.add_router,
|
|
28
|
+
"start_flask_mock_server": flask_mock_server_instance.start_mock_server,
|
|
29
|
+
}
|
|
@@ -9,7 +9,7 @@ from je_api_testka.utils.exception.exceptions import APITesterJsonException
|
|
|
9
9
|
lock = Lock()
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
def read_action_json(json_file_path: str):
|
|
12
|
+
def read_action_json(json_file_path: str) -> dict:
|
|
13
13
|
"""
|
|
14
14
|
read the action json
|
|
15
15
|
:param json_file_path json file's path to read
|
|
@@ -26,7 +26,7 @@ def read_action_json(json_file_path: str):
|
|
|
26
26
|
lock.release()
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
def write_action_json(json_save_path: str, action_json: list):
|
|
29
|
+
def write_action_json(json_save_path: str, action_json: list) -> None:
|
|
30
30
|
"""
|
|
31
31
|
write action json
|
|
32
32
|
:param json_save_path json save path
|
|
@@ -8,7 +8,7 @@ from je_api_testka.utils.exception.exception_tags import wrong_json_data_error
|
|
|
8
8
|
from je_api_testka.utils.exception.exceptions import APITesterJsonException
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def __process_json(json_string: str, **kwargs):
|
|
11
|
+
def __process_json(json_string: str, **kwargs) -> str:
|
|
12
12
|
"""
|
|
13
13
|
:param json_string: full json str (not json type)
|
|
14
14
|
:param kwargs: any another kwargs for dumps
|
|
@@ -26,7 +26,7 @@ def __process_json(json_string: str, **kwargs):
|
|
|
26
26
|
raise APITesterJsonException(wrong_json_data_error)
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
def reformat_json(json_string: str, **kwargs):
|
|
29
|
+
def reformat_json(json_string: str, **kwargs) -> str:
|
|
30
30
|
"""
|
|
31
31
|
:param json_string: valid json string
|
|
32
32
|
:param kwargs: indent, sort_keys or another args
|
|
@@ -18,11 +18,11 @@ class FlaskMockServer(object):
|
|
|
18
18
|
self.host = host
|
|
19
19
|
self.port = port
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
def api_testka_index_function(
|
|
21
|
+
@classmethod
|
|
22
|
+
def api_testka_index_function(cls) -> str:
|
|
23
23
|
return "APITestka main index"
|
|
24
24
|
|
|
25
|
-
def add_router(self, rule_and_function_dict: dict, **kwargs):
|
|
25
|
+
def add_router(self, rule_and_function_dict: dict, **kwargs) -> None:
|
|
26
26
|
"""
|
|
27
27
|
:param rule_and_function_dict: dict include {"rule(path): function"}
|
|
28
28
|
:param kwargs: use to set methods or another param
|
|
@@ -34,7 +34,7 @@ class FlaskMockServer(object):
|
|
|
34
34
|
else:
|
|
35
35
|
raise MockServerException(get_bad_api_router_setting)
|
|
36
36
|
|
|
37
|
-
def start_mock_server(self):
|
|
37
|
+
def start_mock_server(self) -> None:
|
|
38
38
|
"""
|
|
39
39
|
start mock server
|
|
40
40
|
"""
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import typing
|
|
1
2
|
from importlib import import_module
|
|
2
3
|
from importlib.util import find_spec
|
|
3
4
|
from inspect import getmembers, isfunction, isbuiltin, isclass
|
|
@@ -12,7 +13,7 @@ class PackageManager(object):
|
|
|
12
13
|
self.executor = None
|
|
13
14
|
self.callback_executor = None
|
|
14
15
|
|
|
15
|
-
def check_package(self, package: str):
|
|
16
|
+
def check_package(self, package: str) -> typing.Union[str, None]:
|
|
16
17
|
"""
|
|
17
18
|
:param package: package to check exists or not
|
|
18
19
|
:return: package if find else None
|
|
@@ -37,7 +38,7 @@ class PackageManager(object):
|
|
|
37
38
|
target=self.executor
|
|
38
39
|
)
|
|
39
40
|
|
|
40
|
-
def add_package_to_callback_executor(self, package):
|
|
41
|
+
def add_package_to_callback_executor(self, package) -> None:
|
|
41
42
|
"""
|
|
42
43
|
:param package: package's function will add to callback_executor
|
|
43
44
|
"""
|
|
@@ -46,7 +47,7 @@ class PackageManager(object):
|
|
|
46
47
|
target=self.callback_executor
|
|
47
48
|
)
|
|
48
49
|
|
|
49
|
-
def get_member(self, package, predicate, target):
|
|
50
|
+
def get_member(self, package, predicate, target) -> None:
|
|
50
51
|
"""
|
|
51
52
|
:param package: package we want to get member
|
|
52
53
|
:param predicate: predicate
|
|
@@ -63,7 +64,7 @@ class PackageManager(object):
|
|
|
63
64
|
else:
|
|
64
65
|
print(f"Executor error {self.executor}", file=stderr)
|
|
65
66
|
|
|
66
|
-
def add_package_to_target(self, package, target):
|
|
67
|
+
def add_package_to_target(self, package, target) -> None:
|
|
67
68
|
"""
|
|
68
69
|
:param package: package we want to get member
|
|
69
70
|
:param target: which event_dict will be added
|
|
@@ -8,7 +8,7 @@ from je_api_testka.utils.executor.action_executor import execute_action
|
|
|
8
8
|
|
|
9
9
|
class TCPServerHandler(socketserver.BaseRequestHandler):
|
|
10
10
|
|
|
11
|
-
def handle(self):
|
|
11
|
+
def handle(self) -> None:
|
|
12
12
|
command_string = str(self.request.recv(8192).strip(), encoding="utf-8")
|
|
13
13
|
socket = self.request
|
|
14
14
|
print("command is: " + command_string, flush=True)
|
|
@@ -39,12 +39,12 @@ class TCPServerHandler(socketserver.BaseRequestHandler):
|
|
|
39
39
|
|
|
40
40
|
class TCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
|
|
41
41
|
|
|
42
|
-
def __init__(self, server_address,
|
|
43
|
-
super().__init__(server_address,
|
|
42
|
+
def __init__(self, server_address, request_handler_class):
|
|
43
|
+
super().__init__(server_address, request_handler_class)
|
|
44
44
|
self.close_flag: bool = False
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
def start_apitestka_socket_server(host: str = "localhost", port: int = 9939):
|
|
47
|
+
def start_apitestka_socket_server(host: str = "localhost", port: int = 9939) -> TCPServer:
|
|
48
48
|
if len(sys.argv) == 2:
|
|
49
49
|
host = sys.argv[1]
|
|
50
50
|
elif len(sys.argv) == 3:
|
|
@@ -2,7 +2,7 @@ from collections import defaultdict
|
|
|
2
2
|
from xml.etree import ElementTree
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
def elements_tree_to_dict(elements_tree):
|
|
5
|
+
def elements_tree_to_dict(elements_tree) -> dict:
|
|
6
6
|
"""
|
|
7
7
|
:param elements_tree: full xml string
|
|
8
8
|
:return: xml str to dict
|
|
@@ -28,7 +28,7 @@ def elements_tree_to_dict(elements_tree):
|
|
|
28
28
|
return elements_dict
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def dict_to_elements_tree(json_dict: dict):
|
|
31
|
+
def dict_to_elements_tree(json_dict: dict) -> str:
|
|
32
32
|
"""
|
|
33
33
|
:param json_dict: json dict
|
|
34
34
|
:return: json dict to xml string
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: je-api-testka-dev
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.89
|
|
4
4
|
Summary: Requests Automation Framework
|
|
5
5
|
Author-email: JE-Chen <jechenmailman@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -22,11 +22,13 @@ Description-Content-Type: text/markdown
|
|
|
22
22
|
|
|
23
23
|
[](https://www.codacy.com/gh/JE-Chen/APITestka/dashboard?utm_source=github.com&utm_medium=referral&utm_content=JE-Chen/APITestka&utm_campaign=Badge_Grade)
|
|
24
24
|
|
|
25
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_8.yml)
|
|
26
26
|
|
|
27
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_9.yml)
|
|
28
28
|
|
|
29
|
-
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_10.yml)
|
|
30
|
+
|
|
31
|
+
[](https://github.com/Intergration-Automation-Testing/APITestka/actions/workflows/stable_python3_11.yml)
|
|
30
32
|
|
|
31
33
|
### Documentation
|
|
32
34
|
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka_dev.egg-info/SOURCES.txt
RENAMED
|
@@ -23,6 +23,8 @@ je_api_testka/utils/generate_report/json_report.py
|
|
|
23
23
|
je_api_testka/utils/generate_report/xml_report.py
|
|
24
24
|
je_api_testka/utils/get_data_strcture/__init__.py
|
|
25
25
|
je_api_testka/utils/get_data_strcture/get_api_data.py
|
|
26
|
+
je_api_testka/utils/global_dict/__init__.py
|
|
27
|
+
je_api_testka/utils/global_dict/event_dict.py
|
|
26
28
|
je_api_testka/utils/json/__init__.py
|
|
27
29
|
je_api_testka/utils/json/json_file/__init__.py
|
|
28
30
|
je_api_testka/utils/json/json_file/json_file.py
|
|
File without changes
|
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/requests_wrapper/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/assert_result/__init__.py
RENAMED
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/callback/__init__.py
RENAMED
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/exception/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/exception/exceptions.py
RENAMED
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/executor/__init__.py
RENAMED
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/file_process/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka/utils/xml/xml_file/xml_file.py
RENAMED
|
File without changes
|
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka_dev.egg-info/requires.txt
RENAMED
|
File without changes
|
{je_api_testka_dev-0.0.87 → je_api_testka_dev-0.0.89}/je_api_testka_dev.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|