testit-python-commons 3.10.9__tar.gz → 3.10.9.post550__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 (51) hide show
  1. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/PKG-INFO +2 -2
  2. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/setup.py +2 -2
  3. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/api_client.py +0 -12
  4. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/converter.py +20 -1
  5. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/decorators.py +2 -1
  6. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/test_result.py +3 -1
  7. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/plugin_manager.py +8 -28
  8. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/utils/html_escape_utils.py +2 -0
  9. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons.egg-info/PKG-INFO +2 -2
  10. testit_python_commons-3.10.9.post550/src/testit_python_commons.egg-info/requires.txt +3 -0
  11. testit_python_commons-3.10.9/src/testit_python_commons.egg-info/requires.txt +0 -3
  12. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/README.md +0 -0
  13. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/setup.cfg +0 -0
  14. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit.py +0 -0
  15. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/__init__.py +0 -0
  16. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/app_properties.py +0 -0
  17. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/__init__.py +0 -0
  18. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/client_configuration.py +0 -0
  19. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/helpers/__init__.py +0 -0
  20. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/helpers/bulk_autotest_helper.py +0 -0
  21. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/helpers/threads_manager.py +0 -0
  22. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/models/__init__.py +0 -0
  23. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/models/threads_for_create_and_result.py +0 -0
  24. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/client/models/threads_for_update_and_result.py +0 -0
  25. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/dynamic_methods.py +0 -0
  26. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/__init__.py +0 -0
  27. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/adapter_mode.py +0 -0
  28. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/fixture.py +0 -0
  29. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/link.py +0 -0
  30. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/link_type.py +0 -0
  31. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/outcome_type.py +0 -0
  32. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/step_result.py +0 -0
  33. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/models/test_result_with_all_fixture_step_results_model.py +0 -0
  34. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/__init__.py +0 -0
  35. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/adapter_manager.py +0 -0
  36. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/adapter_manager_configuration.py +0 -0
  37. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/fixture_manager.py +0 -0
  38. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/fixture_storage.py +0 -0
  39. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/logger.py +0 -0
  40. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/retry.py +0 -0
  41. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/step_manager.py +0 -0
  42. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/step_result_storage.py +0 -0
  43. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/services/utils.py +0 -0
  44. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/step.py +0 -0
  45. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons/utils/__init__.py +0 -0
  46. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons.egg-info/SOURCES.txt +0 -0
  47. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons.egg-info/dependency_links.txt +0 -0
  48. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/src/testit_python_commons.egg-info/top_level.txt +0 -0
  49. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/tests/test_app_properties.py +0 -0
  50. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/tests/test_dynamic_methods.py +0 -0
  51. {testit_python_commons-3.10.9 → testit_python_commons-3.10.9.post550}/tests/test_html_escape_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testit-python-commons
3
- Version: 3.10.9
3
+ Version: 3.10.9.post550
4
4
  Summary: Python commons for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.12
17
17
  Description-Content-Type: text/markdown
18
18
  Requires-Dist: pluggy
19
19
  Requires-Dist: tomli
20
- Requires-Dist: testit-api-client==7.2.0
20
+ Requires-Dist: testit-api-client==7.2.0.post550
21
21
  Dynamic: author
22
22
  Dynamic: author-email
23
23
  Dynamic: classifier
@@ -1,6 +1,6 @@
1
1
  from setuptools import find_packages, setup
2
2
 
3
- VERSION = "3.10.9"
3
+ VERSION = "3.10.9.post550"
4
4
 
5
5
  setup(
6
6
  name='testit-python-commons',
@@ -25,5 +25,5 @@ setup(
25
25
  py_modules=['testit', 'testit_python_commons'],
26
26
  packages=find_packages(where='src'),
27
27
  package_dir={'': 'src'},
28
- install_requires=['pluggy', 'tomli', 'testit-api-client==7.2.0']
28
+ install_requires=['pluggy', 'tomli', 'testit-api-client==7.2.0.post550']
29
29
  )
@@ -61,7 +61,6 @@ class ApiClientWorker:
61
61
  header_value='PrivateToken ' + token)
62
62
 
63
63
  @adapter_logger
64
- @retry
65
64
  def create_test_run(self, test_run_name: str = None) -> str:
66
65
  test_run_name = f'TestRun_{datetime.today().strftime("%Y-%m-%dT%H:%M:%S")}' if \
67
66
  not test_run_name else test_run_name
@@ -74,7 +73,6 @@ class ApiClientWorker:
74
73
 
75
74
  return Converter.get_id_from_create_test_run_response(response)
76
75
 
77
- @retry
78
76
  def get_test_run(self, test_run_id: str) -> TestRunV2ApiResult:
79
77
  """Function gets test run and returns test run."""
80
78
  logging.debug(f"Getting test run by id {test_run_id}")
@@ -87,7 +85,6 @@ class ApiClientWorker:
87
85
  logging.error(f"Test run by id {test_run_id} not found!")
88
86
  raise Exception(f"Test run by id {test_run_id} not found!")
89
87
 
90
- @retry
91
88
  def update_test_run(self, test_run: TestRunV2ApiResult) -> None:
92
89
  """Function updates test run."""
93
90
  model = Converter.build_update_empty_request(test_run)
@@ -114,7 +111,6 @@ class ApiClientWorker:
114
111
  raise Exception('The autotests with the status "InProgress" ' +
115
112
  f'and the configuration id "{self.__config.get_configuration_id()}" were not found!')
116
113
 
117
- @retry
118
114
  def __get_test_results(self) -> List[TestResultShortResponse]:
119
115
  all_test_results = []
120
116
  skip = 0
@@ -142,7 +138,6 @@ class ApiClientWorker:
142
138
  return all_test_results
143
139
 
144
140
  @adapter_logger
145
- @retry
146
141
  def __get_autotests_by_external_id(self, external_id: str) -> List[AutoTestApiResult]:
147
142
  model = Converter.project_id_and_external_id_to_auto_tests_search_post_request(
148
143
  self.__config.get_project_id(),
@@ -286,7 +281,6 @@ class ApiClientWorker:
286
281
  logging.error(f'Getting workitem by id {work_item_id} status: {exc}')
287
282
 
288
283
  @adapter_logger
289
- @retry
290
284
  def __get_work_items_linked_to_autotest(self, autotest_global_id: str) -> List[WorkItemIdentifierModel]:
291
285
  return self.__autotest_api.get_work_items_linked_to_auto_test(id=autotest_global_id)
292
286
 
@@ -309,7 +303,6 @@ class ApiClientWorker:
309
303
  self.__link_test_to_work_item(autotest_global_id, work_item_id)
310
304
 
311
305
  @adapter_logger
312
- @retry
313
306
  def __create_test(self, test_result: TestResult) -> str:
314
307
  logging.debug(f'Autotest "{test_result.get_autotest_name()}" was not found')
315
308
 
@@ -328,7 +321,6 @@ class ApiClientWorker:
328
321
  return autotest_response.id
329
322
 
330
323
  @adapter_logger
331
- @retry
332
324
  def __create_tests(self, autotests_for_create: List[AutoTestPostModel]) -> None:
333
325
  logging.debug(f'Creating autotests: "{autotests_for_create}')
334
326
 
@@ -337,7 +329,6 @@ class ApiClientWorker:
337
329
  logging.debug(f'Autotests were created')
338
330
 
339
331
  @adapter_logger
340
- @retry
341
332
  def __update_test(self, test_result: TestResult, autotest: AutoTestApiResult) -> None:
342
333
  logging.debug(f'Autotest "{test_result.get_autotest_name()}" was found')
343
334
 
@@ -351,7 +342,6 @@ class ApiClientWorker:
351
342
  logging.debug(f'Autotest "{test_result.get_autotest_name()}" was updated')
352
343
 
353
344
  @adapter_logger
354
- @retry
355
345
  def __update_tests(self, autotests_for_update: List[AutoTestPutModel]) -> None:
356
346
  logging.debug(f'Updating autotests: {autotests_for_update}')
357
347
 
@@ -378,7 +368,6 @@ class ApiClientWorker:
378
368
  logging.debug(f'Autotest was linked with workItem "{work_item_id}" by global id "{autotest_global_id}')
379
369
 
380
370
  @adapter_logger
381
- @retry
382
371
  def __load_test_result(self, test_result: TestResult) -> str:
383
372
  model = Converter.test_result_to_testrun_result_post_model(
384
373
  test_result,
@@ -394,7 +383,6 @@ class ApiClientWorker:
394
383
  return Converter.get_test_result_id_from_testrun_result_post_response(response)
395
384
 
396
385
  @adapter_logger
397
- @retry
398
386
  def get_test_result_by_id(self, test_result_id: str) -> TestResultResponse:
399
387
  return self.__test_results_api.api_v2_test_results_id_get(id=test_result_id)
400
388
 
@@ -26,6 +26,7 @@ from testit_api_client.models import (
26
26
  TestResultResponse,
27
27
  AttachmentApiResult,
28
28
  AttachmentUpdateRequest,
29
+ AttachmentPutModel,
29
30
  UpdateEmptyRequest,
30
31
  LinkApiResult,
31
32
  UpdateLinkApiModel,
@@ -420,6 +421,24 @@ class Converter:
420
421
  def attachment_model_to_attachment_put_model(attachment: AttachmentApiResult) -> AttachmentUpdateRequest:
421
422
  return AttachmentUpdateRequest(id=attachment.id)
422
423
 
424
+ @classmethod
425
+ @adapter_logger
426
+ def build_attachment_update_requests(
427
+ cls, attachments: List[AttachmentPutModel]) -> List[AttachmentUpdateRequest]:
428
+ put_model_attachments = []
429
+
430
+ for attachment in attachments:
431
+ put_model_attachments.append(
432
+ cls.build_attachment_update_request(attachment)
433
+ )
434
+
435
+ return put_model_attachments
436
+
437
+ @staticmethod
438
+ @adapter_logger
439
+ def build_attachment_update_request(attachment: AttachmentPutModel) -> AttachmentUpdateRequest:
440
+ return AttachmentUpdateRequest(id=attachment.id)
441
+
423
442
  @classmethod
424
443
  # @adapter_logger
425
444
  def step_results_to_autotest_steps_model(
@@ -498,7 +517,7 @@ class Converter:
498
517
  description=step_result.get_description(),
499
518
  duration=step_result.get_duration(),
500
519
  parameters=step_result.get_parameters(),
501
- attachments=step_result.get_attachments(),
520
+ attachments=cls.build_attachment_update_requests(step_result.get_attachments()),
502
521
  started_on=step_result.get_started_on(),
503
522
  completed_on=step_result.get_completed_on(),
504
523
  step_results=cls.step_results_to_auto_test_step_result_update_request(
@@ -1,4 +1,5 @@
1
1
  import asyncio
2
+ import inspect
2
3
  import logging
3
4
  import types
4
5
  from functools import wraps
@@ -28,7 +29,7 @@ def inner(function):
28
29
  await function(*args, **kwargs)
29
30
 
30
31
  if isinstance(function, types.FunctionType):
31
- if asyncio.iscoroutinefunction(function):
32
+ if inspect.iscoroutinefunction(function):
32
33
  return async_wrapper
33
34
 
34
35
  return sync_wrapper
@@ -34,7 +34,9 @@ class TestResult:
34
34
 
35
35
  @adapter_logger
36
36
  def set_external_id(self, external_id: str):
37
- self.__external_id = HtmlEscapeUtils.escape_html_tags(external_id)
37
+ # don't use escaping for externalId
38
+ # self.__external_id = HtmlEscapeUtils.escape_html_tags(external_id)
39
+ self.__external_id = external_id
38
40
 
39
41
  return self
40
42
 
@@ -2,8 +2,8 @@ import logging
2
2
 
3
3
  from pluggy import PluginManager
4
4
 
5
- from testit_python_commons.app_properties import AppProperties
6
5
  from testit_python_commons.services.step_manager import StepManager
6
+ from testit_python_commons.app_properties import AppProperties
7
7
 
8
8
 
9
9
  class TmsPluginManager:
@@ -16,32 +16,26 @@ class TmsPluginManager:
16
16
  @classmethod
17
17
  def get_plugin_manager(cls):
18
18
  if cls.__plugin_manager is None:
19
- cls.__plugin_manager = PluginManager("testit")
19
+ cls.__plugin_manager = PluginManager('testit')
20
20
 
21
21
  return cls.__plugin_manager
22
22
 
23
23
  @classmethod
24
24
  def get_adapter_manager(cls, option=None):
25
25
  if cls.__adapter_manager is None:
26
- from testit_python_commons.client.client_configuration import (
27
- ClientConfiguration,
28
- )
29
26
  from testit_python_commons.services.adapter_manager import AdapterManager
30
- from testit_python_commons.services.adapter_manager_configuration import (
31
- AdapterManagerConfiguration,
32
- )
27
+ from testit_python_commons.client.client_configuration import ClientConfiguration
28
+ from testit_python_commons.services.adapter_manager_configuration import AdapterManagerConfiguration
33
29
 
34
30
  app_properties = AppProperties.load_properties(option)
35
31
 
36
- cls.get_logger(app_properties.get("logs") == "true")
32
+ cls.get_logger(app_properties.get('logs') == 'true')
37
33
 
38
34
  client_configuration = ClientConfiguration(app_properties)
39
35
  adapter_configuration = AdapterManagerConfiguration(app_properties)
40
36
  fixture_manager = cls.get_fixture_manager()
41
37
 
42
- cls.__adapter_manager = AdapterManager(
43
- adapter_configuration, client_configuration, fixture_manager
44
- )
38
+ cls.__adapter_manager = AdapterManager(adapter_configuration, client_configuration, fixture_manager)
45
39
 
46
40
  return cls.__adapter_manager
47
41
 
@@ -64,26 +58,12 @@ class TmsPluginManager:
64
58
  @classmethod
65
59
  def get_logger(cls, debug: bool = False):
66
60
  if cls.__logger is None:
67
- # Fix for live log duplication issue
68
- # Create a dedicated handler for TmsLogger to avoid affecting global logging configuration
69
- cls.__logger = logging.getLogger("TmsLogger")
70
-
71
- # Only add handler if none exists to prevent duplicates
72
- if not cls.__logger.handlers:
73
- handler = logging.StreamHandler()
74
- formatter = logging.Formatter(
75
- "\n%(levelname)s (%(asctime)s): %(message)s"
76
- )
77
- handler.setFormatter(formatter)
78
- cls.__logger.addHandler(handler)
79
-
80
61
  # Always show WARNING and above (WARNING, ERROR, CRITICAL)
81
62
  # Only show DEBUG and INFO when debug mode is enabled
82
63
  level = logging.DEBUG if debug else logging.WARNING
83
- cls.__logger.setLevel(level)
64
+ logging.basicConfig(format='\n%(levelname)s (%(asctime)s): %(message)s', level=level)
84
65
 
85
- # Prevent propagation to root logger to avoid interference with user loggers
86
- cls.__logger.propagate = False
66
+ cls.__logger = logging.getLogger('TmsLogger')
87
67
 
88
68
  return cls.__logger
89
69
 
@@ -123,6 +123,8 @@ class HtmlEscapeUtils:
123
123
  # Skip private/protected attributes and methods
124
124
  if attr_name.startswith('_') or callable(getattr(obj, attr_name, None)):
125
125
  continue
126
+ if attr_name.startswith("external_id") or attr_name.startswith("externalId"):
127
+ continue
126
128
 
127
129
  try:
128
130
  value = getattr(obj, attr_name)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testit-python-commons
3
- Version: 3.10.9
3
+ Version: 3.10.9.post550
4
4
  Summary: Python commons for Test IT
5
5
  Home-page: https://github.com/testit-tms/adapters-python/
6
6
  Author: Integration team
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.12
17
17
  Description-Content-Type: text/markdown
18
18
  Requires-Dist: pluggy
19
19
  Requires-Dist: tomli
20
- Requires-Dist: testit-api-client==7.2.0
20
+ Requires-Dist: testit-api-client==7.2.0.post550
21
21
  Dynamic: author
22
22
  Dynamic: author-email
23
23
  Dynamic: classifier
@@ -0,0 +1,3 @@
1
+ pluggy
2
+ tomli
3
+ testit-api-client==7.2.0.post550
@@ -1,3 +0,0 @@
1
- pluggy
2
- tomli
3
- testit-api-client==7.2.0