testit-python-commons 3.2.3__tar.gz → 3.2.5__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.
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/PKG-INFO +1 -1
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/setup.py +1 -1
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/dynamic_methods.py +2 -2
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/adapter_manager.py +4 -2
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/utils.py +24 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/step.py +3 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons.egg-info/PKG-INFO +1 -1
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/README.md +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/setup.cfg +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/__init__.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/app_properties.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/client/__init__.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/client/api_client.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/client/client_configuration.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/client/converter.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/decorators.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/__init__.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/adapter_mode.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/link.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/link_type.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/outcome_type.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/step_result.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/test_result.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/test_result_with_all_fixture_step_results_model.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/__init__.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/adapter_manager_configuration.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/logger.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/plugin_manager.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/retry.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/step_manager.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/services/step_result_storage.py +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons.egg-info/SOURCES.txt +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons.egg-info/dependency_links.txt +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons.egg-info/requires.txt +0 -0
- {testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons.egg-info/top_level.txt +0 -0
|
@@ -84,7 +84,7 @@ def addAttachments(data, is_text: bool = False, name: str = None): # noqa: N80
|
|
|
84
84
|
@adapter_logger
|
|
85
85
|
def add_attachments_to_step(step, data, is_text: bool = False, name: str = None):
|
|
86
86
|
if is_text:
|
|
87
|
-
attachment_ids = TmsPluginManager.get_adapter_manager().create_attachment(
|
|
87
|
+
attachment_ids = TmsPluginManager.get_adapter_manager().create_attachment(data, name)
|
|
88
88
|
else:
|
|
89
89
|
if isinstance(data, str):
|
|
90
90
|
attachment_ids = TmsPluginManager.get_adapter_manager().load_attachments([data])
|
|
@@ -102,7 +102,7 @@ def add_attachments_to_test(data, is_text: bool = False, name: str = None):
|
|
|
102
102
|
if is_text and hasattr(TmsPluginManager.get_plugin_manager().hook, 'create_attachment'):
|
|
103
103
|
TmsPluginManager.get_plugin_manager().hook \
|
|
104
104
|
.create_attachment(
|
|
105
|
-
body=
|
|
105
|
+
body=data,
|
|
106
106
|
name=name)
|
|
107
107
|
elif hasattr(TmsPluginManager.get_plugin_manager().hook, 'add_attachments'):
|
|
108
108
|
if isinstance(data, str):
|
|
@@ -9,6 +9,7 @@ from testit_python_commons.models.test_result import TestResult
|
|
|
9
9
|
from testit_python_commons.models.test_result_with_all_fixture_step_results_model import TestResultWithAllFixtureStepResults
|
|
10
10
|
from testit_python_commons.services.adapter_manager_configuration import AdapterManagerConfiguration
|
|
11
11
|
from testit_python_commons.services.logger import adapter_logger
|
|
12
|
+
from testit_python_commons.services.utils import Utils
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class AdapterManager:
|
|
@@ -54,14 +55,15 @@ class AdapterManager:
|
|
|
54
55
|
return self.__api_client.load_attachments(attach_paths)
|
|
55
56
|
|
|
56
57
|
@adapter_logger
|
|
57
|
-
def create_attachment(self, body
|
|
58
|
+
def create_attachment(self, body, name: str):
|
|
58
59
|
if name is None:
|
|
59
60
|
name = str(uuid.uuid4()) + '-attachment.txt'
|
|
60
61
|
|
|
61
62
|
path = os.path.join(os.path.abspath(''), name)
|
|
62
63
|
|
|
63
64
|
with open(path, 'wb') as attached_file:
|
|
64
|
-
attached_file.write(
|
|
65
|
+
attached_file.write(
|
|
66
|
+
Utils.convert_body_of_attachment(body))
|
|
65
67
|
|
|
66
68
|
attachment_id = self.__api_client.load_attachments((path,))
|
|
67
69
|
|
|
@@ -69,6 +69,22 @@ class Utils:
|
|
|
69
69
|
|
|
70
70
|
return parameters
|
|
71
71
|
|
|
72
|
+
@staticmethod
|
|
73
|
+
def collect_parameters_in_string_attribute(attribute: str, all_parameters: dict) -> str:
|
|
74
|
+
param_keys = []
|
|
75
|
+
|
|
76
|
+
if attribute:
|
|
77
|
+
param_keys = re.findall(r"\{(.*?)\}", attribute)
|
|
78
|
+
|
|
79
|
+
if len(param_keys) > 0:
|
|
80
|
+
for param_key in param_keys:
|
|
81
|
+
parameter = all_parameters.get(param_key)
|
|
82
|
+
|
|
83
|
+
if parameter is not None:
|
|
84
|
+
attribute = attribute.replace("{" + param_key + "}", str(parameter))
|
|
85
|
+
|
|
86
|
+
return attribute
|
|
87
|
+
|
|
72
88
|
@staticmethod
|
|
73
89
|
@adapter_logger
|
|
74
90
|
def convert_link_dict_to_link_model(link_dict: dict) -> Link:
|
|
@@ -85,3 +101,11 @@ class Utils:
|
|
|
85
101
|
link_model.set_description(link_dict['description'])
|
|
86
102
|
|
|
87
103
|
return link_model
|
|
104
|
+
|
|
105
|
+
@staticmethod
|
|
106
|
+
@adapter_logger
|
|
107
|
+
def convert_body_of_attachment(body):
|
|
108
|
+
if isinstance(body, bytes):
|
|
109
|
+
return body
|
|
110
|
+
|
|
111
|
+
return str(body).encode('utf-8')
|
{testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/step.py
RENAMED
|
@@ -55,6 +55,9 @@ class StepContext:
|
|
|
55
55
|
self.__start_time = round(datetime.utcnow().timestamp() * 1000)
|
|
56
56
|
self.__step_result = StepResult()
|
|
57
57
|
|
|
58
|
+
self.__title = Utils.collect_parameters_in_string_attribute(self.__title, self.__parameters)
|
|
59
|
+
self.__description = Utils.collect_parameters_in_string_attribute(self.__description, self.__parameters)
|
|
60
|
+
|
|
58
61
|
self.__step_result\
|
|
59
62
|
.set_title(self.__title)\
|
|
60
63
|
.set_description(self.__description)\
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/decorators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testit_python_commons-3.2.3 → testit_python_commons-3.2.5}/src/testit_python_commons/models/link.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
|