qase-python-commons 3.2.1__py3-none-any.whl → 3.2.2__py3-none-any.whl

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.

Potentially problematic release.


This version of qase-python-commons might be problematic. Click here for more details.

@@ -89,7 +89,7 @@ class ApiV1Client(BaseApiClient):
89
89
  return response.result
90
90
 
91
91
  except Exception as e:
92
- self.logger.log(f"Error at uploading attachment: {e}", "debug")
92
+ self.logger.log(f"Error at uploading attachment: {e}", "error")
93
93
  return None
94
94
 
95
95
  def create_test_run(self, project_code: str, title: str, description: str, plan_id=None,
@@ -16,6 +16,7 @@ from qase.api_client_v2.models.result_steps_type import ResultStepsType
16
16
  from .api_v1_client import ApiV1Client
17
17
  from .. import Logger
18
18
  from ..exceptions.reporter import ReporterException
19
+ from ..models.config.framework import Video, Trace
19
20
  from ..models import Attachment, Result
20
21
  from ..models.config.qaseconfig import QaseConfig
21
22
  from ..models.step import StepType, Step
@@ -56,7 +57,11 @@ class ApiV2Client(ApiV1Client):
56
57
  attached = []
57
58
  if result.attachments:
58
59
  for attachment in result.attachments:
59
- attached.extend(self._upload_attachment(project_code, attachment))
60
+ if self.__should_skip_attachment(attachment, result):
61
+ continue
62
+ attach_id = self._upload_attachment(project_code, attachment)
63
+ if attach_id:
64
+ attached.extend(attach_id)
60
65
 
61
66
  steps = []
62
67
  for step in result.steps:
@@ -142,7 +147,9 @@ class ApiV2Client(ApiV1Client):
142
147
  if step.attachments:
143
148
  uploaded_attachments = []
144
149
  for file in step.attachments:
145
- uploaded_attachments.extend(self._upload_attachment(project_code, file))
150
+ attach_id = self._upload_attachment(project_code, file)
151
+ if attach_id:
152
+ uploaded_attachments.extend(attach_id)
146
153
 
147
154
  prepared_step['execution']['attachments'] = [attach.hash for attach in uploaded_attachments]
148
155
 
@@ -154,3 +161,14 @@ class ApiV2Client(ApiV1Client):
154
161
  except Exception as e:
155
162
  self.logger.log(f"Error at preparing step: {e}", "error")
156
163
  raise ReporterException(e)
164
+
165
+ def __should_skip_attachment(self, attachment, result):
166
+ if (self.config.framework.playwright.video == Video.failed and
167
+ result.execution.status != 'failed' and
168
+ attachment.file_name == 'video.webm'):
169
+ return True
170
+ if (self.config.framework.playwright.trace == Trace.failed and
171
+ result.execution.status != 'failed' and
172
+ attachment.file_name == 'trace.zip'):
173
+ return True
174
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qase-python-commons
3
- Version: 3.2.1
3
+ Version: 3.2.2
4
4
  Summary: A library for Qase TestOps and Qase Report
5
5
  Author-email: Qase Team <support@qase.io>
6
6
  Project-URL: Homepage, https://github.com/qase-tms/qase-python/tree/master/qase-python-commons
@@ -24,12 +24,12 @@ Requires-Dist: certifi>=2024.2.2
24
24
  Requires-Dist: attrs>=23.2.0
25
25
  Requires-Dist: qase-api-client~=1.1.1
26
26
  Requires-Dist: qase-api-v2-client~=1.1.0
27
- Requires-Dist: more-itertools
27
+ Requires-Dist: more_itertools
28
28
  Provides-Extra: testing
29
29
  Requires-Dist: pytest; extra == "testing"
30
30
  Requires-Dist: pytest-cov; extra == "testing"
31
31
  Requires-Dist: mock; extra == "testing"
32
- Requires-Dist: more-itertools; extra == "testing"
32
+ Requires-Dist: more_itertools; extra == "testing"
33
33
  Requires-Dist: requests; extra == "testing"
34
34
  Requires-Dist: urllib3; extra == "testing"
35
35
 
@@ -3,8 +3,8 @@ qase/commons/config.py,sha256=meRRgDrsA9qQ9fZR4fnP0VdngrKiGcHF9nnJkf3eJpg,8320
3
3
  qase/commons/loader.py,sha256=-MMY4HgSI6q1xq3NaJoq_w4liM73qdFKjYLVCT1E7Pc,1064
4
4
  qase/commons/logger.py,sha256=ka5chQYBXLUB5pM4YHDBo3QCZfBTGMtC3H33tI4NbPQ,1027
5
5
  qase/commons/utils.py,sha256=OOr6kQ5hPZEyHXwbwiTOTkonRxmmtkyZPPGqXQKp5vY,2799
6
- qase/commons/client/api_v1_client.py,sha256=YIaRWu9txJoIljcvPJ-4MECqgw72oae-o6z0Bl9t-Jo,12715
7
- qase/commons/client/api_v2_client.py,sha256=sh748gx9jjqBm42IrSeOduBWs6jKzz5QqCWSKcURDOA,7440
6
+ qase/commons/client/api_v1_client.py,sha256=0SOuYKdlS0o2s1um5hGxDIp_laJ3vZIEvnZ-E1vLoGo,12715
7
+ qase/commons/client/api_v2_client.py,sha256=EhoGdhorK5nKbi1DD8mNGCHq0EnbEgw-Qdft0A8NSj4,8235
8
8
  qase/commons/client/base_api_client.py,sha256=H8JnjqSrBFNfghDd3T3zxYOyKYHYe9QiJQXol1JqdQk,2613
9
9
  qase/commons/exceptions/reporter.py,sha256=dP-Mwcq8HKBOjgu3YqhyULDmDGU09BmT6Fh9HjICaUc,45
10
10
  qase/commons/models/__init__.py,sha256=FTt5dYASBX4r6-tQi-_JAUVx4uvJs9GTxROdAZEV6Jo,272
@@ -33,7 +33,7 @@ qase/commons/reporters/core.py,sha256=0x5G-KVfEOWyXiXaX5__7JBIr3Rxy8vhy0cByUSZUc
33
33
  qase/commons/reporters/report.py,sha256=zyGeUOcJCOEoGtsewCOf3kypbPttJH7EM-LmZ_Y5huY,4829
34
34
  qase/commons/reporters/testops.py,sha256=f5BcorFwIK5BSeA4Rv4IKDddkWrAXL_w-Y5Xn--NdYs,6264
35
35
  qase/commons/validators/base.py,sha256=wwSn-4YiuXtfGMGnSKgo9Vm5hAKevVmmfd2Ro6Q7MYQ,173
36
- qase_python_commons-3.2.1.dist-info/METADATA,sha256=VI_esbHAjMaJlqkhjqsznHjJgFR374RdeDvfLgK9rB8,1859
37
- qase_python_commons-3.2.1.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
38
- qase_python_commons-3.2.1.dist-info/top_level.txt,sha256=Mn5aFk7H7Uia4s1NRDsvebu8vCrFy9nOuRIBfkIY5kQ,5
39
- qase_python_commons-3.2.1.dist-info/RECORD,,
36
+ qase_python_commons-3.2.2.dist-info/METADATA,sha256=RTj2Gnby5gKknH6p1cZH99-XlWnWToruI6ov2EyOVDY,1859
37
+ qase_python_commons-3.2.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
38
+ qase_python_commons-3.2.2.dist-info/top_level.txt,sha256=Mn5aFk7H7Uia4s1NRDsvebu8vCrFy9nOuRIBfkIY5kQ,5
39
+ qase_python_commons-3.2.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5