testit-python-commons 3.1.0__tar.gz → 3.1.1__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 (35) hide show
  1. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/PKG-INFO +1 -1
  2. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/setup.py +1 -1
  3. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/app_properties.py +33 -16
  4. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons.egg-info/PKG-INFO +1 -1
  5. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/README.md +0 -0
  6. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/setup.cfg +0 -0
  7. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit.py +0 -0
  8. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/__init__.py +0 -0
  9. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/client/__init__.py +0 -0
  10. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/client/api_client.py +0 -0
  11. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/client/client_configuration.py +0 -0
  12. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/client/converter.py +0 -0
  13. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/decorators.py +0 -0
  14. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/dynamic_methods.py +0 -0
  15. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/models/__init__.py +0 -0
  16. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/models/adapter_mode.py +0 -0
  17. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/models/link.py +0 -0
  18. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/models/link_type.py +0 -0
  19. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/models/outcome_type.py +0 -0
  20. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/models/step_result.py +0 -0
  21. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/models/test_result.py +0 -0
  22. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/models/test_result_with_all_fixture_step_results_model.py +0 -0
  23. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/services/__init__.py +0 -0
  24. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/services/adapter_manager.py +0 -0
  25. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/services/adapter_manager_configuration.py +0 -0
  26. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/services/logger.py +0 -0
  27. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/services/plugin_manager.py +0 -0
  28. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/services/step_manager.py +0 -0
  29. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/services/step_result_storage.py +0 -0
  30. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/services/utils.py +0 -0
  31. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons/step.py +0 -0
  32. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons.egg-info/SOURCES.txt +0 -0
  33. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons.egg-info/dependency_links.txt +0 -0
  34. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/src/testit_python_commons.egg-info/requires.txt +0 -0
  35. {testit_python_commons-3.1.0 → testit_python_commons-3.1.1}/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.1.0
3
+ Version: 3.1.1
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.1.0',
5
+ version='3.1.1',
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",
@@ -3,6 +3,8 @@ import logging
3
3
  import os
4
4
  import re
5
5
  import warnings
6
+ import uuid
7
+ from urllib.parse import urlparse
6
8
 
7
9
  from testit_python_commons.models.adapter_mode import AdapterMode
8
10
 
@@ -156,19 +158,25 @@ class AppProperties:
156
158
 
157
159
  return env_properties
158
160
 
159
- @staticmethod
160
- def __check_properties(properties: dict):
161
+ @classmethod
162
+ def __check_properties(cls, properties: dict):
161
163
  adapter_mode = properties.get('adaptermode')
162
164
 
163
165
  if adapter_mode == AdapterMode.NEW_TEST_RUN:
164
- if properties.get('projectid') is None:
165
- logging.error('Adapter mode "2" is enabled. The project ID is needed, but it was not found!')
166
+ try:
167
+ uuid.UUID(str(properties.get('testrunid')))
168
+ logging.error('Adapter mode "2" is enabled. Config should not contains test run id!')
166
169
  raise SystemExit
170
+ except ValueError:
171
+ pass
172
+
167
173
  elif adapter_mode in (
168
174
  AdapterMode.RUN_ALL_TESTS,
169
175
  AdapterMode.USE_FILTER,
170
176
  None):
171
- if properties.get('testrunid') is None:
177
+ try:
178
+ uuid.UUID(str(properties.get('testrunid')))
179
+ except ValueError:
172
180
  logging.error(f'Adapter mode "{adapter_mode if adapter_mode else "0"}" is enabled. '
173
181
  f'The test run ID is needed, but it was not found!')
174
182
  raise SystemExit
@@ -176,26 +184,35 @@ class AppProperties:
176
184
  logging.error(f'Unknown adapter mode "{adapter_mode}"!')
177
185
  raise SystemExit
178
186
 
179
- if properties.get('url') is None:
180
- logging.error('URL was not found!')
187
+ try:
188
+ uuid.UUID(str(properties.get('projectid')))
189
+ except ValueError:
190
+ logging.error('Project ID was not found!')
181
191
  raise SystemExit
182
192
 
183
- if properties.get('privatetoken') is None:
193
+ try:
194
+ url = urlparse(properties.get('url'))
195
+ if not all([url.scheme, url.netloc]):
196
+ raise AttributeError
197
+ except AttributeError:
198
+ logging.error('URL is invalid!')
199
+ raise SystemExit
200
+
201
+ if not cls.__check_property_value(properties.get('privatetoken')):
184
202
  logging.error('Private token was not found!')
185
203
  raise SystemExit
186
204
 
187
- if properties.get('configurationid') is None:
205
+ try:
206
+ uuid.UUID(str(properties.get('configurationid')))
207
+ except ValueError:
188
208
  logging.error('Configuration ID was not found!')
189
209
  raise SystemExit
190
210
 
191
- if properties.get('testrunname'):
192
- properties['testrunname'] = properties['testrunname']
193
-
194
- if properties.get('certvalidation'):
195
- properties['certvalidation'] = properties['certvalidation'].lower()
211
+ if not cls.__check_property_value(properties.get('certvalidation')):
212
+ properties['certvalidation'] = 'true'
196
213
 
197
- if properties.get('automaticcreationtestcases'):
198
- properties['automaticcreationtestcases'] = properties['automaticcreationtestcases'].lower()
214
+ if not cls.__check_property_value(properties.get('automaticcreationtestcases')):
215
+ properties['automaticcreationtestcases'] = 'false'
199
216
 
200
217
  @staticmethod
201
218
  def __search_in_environ(var_name: str):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: testit-python-commons
3
- Version: 3.1.0
3
+ Version: 3.1.1
4
4
  Summary: Python commons for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team