testit-python-commons 3.2.4__tar.gz → 3.2.6__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.
Files changed (36) hide show
  1. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/PKG-INFO +1 -1
  2. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/setup.py +1 -1
  3. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/adapter_manager.py +4 -2
  4. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/utils.py +14 -0
  5. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/step.py +3 -1
  6. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons.egg-info/PKG-INFO +1 -1
  7. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/README.md +0 -0
  8. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/setup.cfg +0 -0
  9. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit.py +0 -0
  10. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/__init__.py +0 -0
  11. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/app_properties.py +0 -0
  12. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/client/__init__.py +0 -0
  13. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/client/api_client.py +0 -0
  14. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/client/client_configuration.py +0 -0
  15. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/client/converter.py +0 -0
  16. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/decorators.py +0 -0
  17. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/dynamic_methods.py +0 -0
  18. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/models/__init__.py +0 -0
  19. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/models/adapter_mode.py +0 -0
  20. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/models/link.py +0 -0
  21. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/models/link_type.py +0 -0
  22. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/models/outcome_type.py +0 -0
  23. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/models/step_result.py +0 -0
  24. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/models/test_result.py +0 -0
  25. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/models/test_result_with_all_fixture_step_results_model.py +0 -0
  26. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/__init__.py +0 -0
  27. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/adapter_manager_configuration.py +0 -0
  28. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/logger.py +0 -0
  29. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/plugin_manager.py +0 -0
  30. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/retry.py +0 -0
  31. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/step_manager.py +0 -0
  32. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons/services/step_result_storage.py +0 -0
  33. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons.egg-info/SOURCES.txt +0 -0
  34. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons.egg-info/dependency_links.txt +0 -0
  35. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons.egg-info/requires.txt +0 -0
  36. {testit_python_commons-3.2.4 → testit_python_commons-3.2.6}/src/testit_python_commons.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: testit-python-commons
3
- Version: 3.2.4
3
+ Version: 3.2.6
4
4
  Summary: Python commons for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
2
2
 
3
3
  setup(
4
4
  name='testit-python-commons',
5
- version='3.2.4',
5
+ version='3.2.6',
6
6
  description='Python commons for Test IT',
7
7
  long_description=open('README.md', "r").read(),
8
8
  long_description_content_type="text/markdown",
@@ -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: str | bytes, name: str):
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(body.encode('utf-8') if isinstance(body, str) else body)
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,12 @@ class Utils:
69
69
 
70
70
  return parameters
71
71
 
72
+ @staticmethod
73
+ def exclude_self_parameter(all_parameters: dict) -> dict:
74
+ if all_parameters.get('self') is not None:
75
+ all_parameters.pop('self')
76
+ return all_parameters
77
+
72
78
  @staticmethod
73
79
  def collect_parameters_in_string_attribute(attribute: str, all_parameters: dict) -> str:
74
80
  param_keys = []
@@ -101,3 +107,11 @@ class Utils:
101
107
  link_model.set_description(link_dict['description'])
102
108
 
103
109
  return link_model
110
+
111
+ @staticmethod
112
+ @adapter_logger
113
+ def convert_body_of_attachment(body):
114
+ if isinstance(body, bytes):
115
+ return body
116
+
117
+ return str(body).encode('utf-8')
@@ -61,7 +61,9 @@ class StepContext:
61
61
  self.__step_result\
62
62
  .set_title(self.__title)\
63
63
  .set_description(self.__description)\
64
- .set_parameters(self.__parameters)
64
+ .set_parameters(
65
+ Utils.exclude_self_parameter(self.__parameters)
66
+ )
65
67
 
66
68
  logging.debug(f'Step "{self.__title}" was started')
67
69
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: testit-python-commons
3
- Version: 3.2.4
3
+ Version: 3.2.6
4
4
  Summary: Python commons for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team