testit-python-commons 3.2.2__tar.gz → 3.2.4__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.2 → testit_python_commons-3.2.4}/PKG-INFO +1 -1
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/setup.py +1 -1
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/dynamic_methods.py +2 -2
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/adapter_manager.py +2 -2
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/utils.py +16 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/step.py +3 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons.egg-info/PKG-INFO +1 -1
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/README.md +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/setup.cfg +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/__init__.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/app_properties.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/client/__init__.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/client/api_client.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/client/client_configuration.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/client/converter.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/decorators.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/models/__init__.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/models/adapter_mode.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/models/link.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/models/link_type.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/models/outcome_type.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/models/step_result.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/models/test_result.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/models/test_result_with_all_fixture_step_results_model.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/__init__.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/adapter_manager_configuration.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/logger.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/plugin_manager.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/retry.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/step_manager.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons/services/step_result_storage.py +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons.egg-info/SOURCES.txt +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons.egg-info/dependency_links.txt +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/src/testit_python_commons.egg-info/requires.txt +0 -0
- {testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/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):
|
|
@@ -54,14 +54,14 @@ class AdapterManager:
|
|
|
54
54
|
return self.__api_client.load_attachments(attach_paths)
|
|
55
55
|
|
|
56
56
|
@adapter_logger
|
|
57
|
-
def create_attachment(self, body: str, name: str):
|
|
57
|
+
def create_attachment(self, body: str | bytes, name: str):
|
|
58
58
|
if name is None:
|
|
59
59
|
name = str(uuid.uuid4()) + '-attachment.txt'
|
|
60
60
|
|
|
61
61
|
path = os.path.join(os.path.abspath(''), name)
|
|
62
62
|
|
|
63
63
|
with open(path, 'wb') as attached_file:
|
|
64
|
-
attached_file.write(body.encode('utf-8'))
|
|
64
|
+
attached_file.write(body.encode('utf-8') if isinstance(body, str) else body)
|
|
65
65
|
|
|
66
66
|
attachment_id = self.__api_client.load_attachments((path,))
|
|
67
67
|
|
|
@@ -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:
|
{testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/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.2 → testit_python_commons-3.2.4}/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.2 → testit_python_commons-3.2.4}/src/testit_python_commons/decorators.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testit_python_commons-3.2.2 → testit_python_commons-3.2.4}/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
|