qase-python-commons 2.0.9__tar.gz → 2.0.11__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 (25) hide show
  1. {qase-python-commons-2.0.9/src/qase_python_commons.egg-info → qase-python-commons-2.0.11}/PKG-INFO +3 -3
  2. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/pyproject.toml +6 -6
  3. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11/src/qase_python_commons.egg-info}/PKG-INFO +3 -3
  4. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qase_python_commons.egg-info/requires.txt +1 -1
  5. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/testops.py +53 -44
  6. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/AUTHORS.rst +0 -0
  7. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/README.md +0 -0
  8. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/setup.cfg +0 -0
  9. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qase_python_commons.egg-info/SOURCES.txt +0 -0
  10. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qase_python_commons.egg-info/dependency_links.txt +0 -0
  11. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qase_python_commons.egg-info/top_level.txt +0 -0
  12. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/__init__.py +0 -0
  13. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/config.py +0 -0
  14. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/interceptor.py +0 -0
  15. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/loader.py +0 -0
  16. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/models/__init__.py +0 -0
  17. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/models/attachment.py +0 -0
  18. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/models/relation.py +0 -0
  19. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/models/result.py +0 -0
  20. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/models/run.py +0 -0
  21. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/models/runtime.py +0 -0
  22. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/models/step.py +0 -0
  23. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/models/suite.py +0 -0
  24. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/report.py +0 -0
  25. {qase-python-commons-2.0.9 → qase-python-commons-2.0.11}/src/qaseio/commons/utils.py +0 -0
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qase-python-commons
3
- Version: 2.0.9
3
+ Version: 2.0.11
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
7
7
  Classifier: Development Status :: 5 - Production/Stable
8
8
  Classifier: Programming Language :: Python
9
- Requires-Python: >=3.8
9
+ Requires-Python: >=3.7
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: AUTHORS.rst
12
12
  Requires-Dist: certifi>=2024.2.2
13
- Requires-Dist: qaseio<5.0.0,>=4.0.0
13
+ Requires-Dist: qaseio<5.0.0,>=4.0.2
14
14
  Requires-Dist: attrs>=23.2.0
15
15
  Requires-Dist: more_itertools
16
16
  Provides-Extra: testing
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["setuptools>=69", "wheel"]
2
+ requires = ["setuptools>=68", "wheel"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qase-python-commons"
7
- version = "2.0.9"
7
+ version = "2.0.11"
8
8
  description = "A library for Qase TestOps and Qase Report"
9
9
  readme = "README.md"
10
10
  authors = [{name = "Qase Team", email = "support@qase.io"}]
@@ -14,10 +14,10 @@ classifiers = [
14
14
  "Programming Language :: Python",
15
15
  ]
16
16
  urls = {"Homepage" = "https://github.com/qase-tms/qase-python/tree/master/qase-python-commons"}
17
- requires-python = ">=3.8"
17
+ requires-python = ">=3.7"
18
18
  dependencies = [
19
19
  "certifi>=2024.2.2",
20
- "qaseio>=4.0.0,<5.0.0",
20
+ "qaseio>=4.0.2,<5.0.0",
21
21
  "attrs>=23.2.0",
22
22
  "more_itertools"
23
23
  ]
@@ -35,8 +35,8 @@ testing = [
35
35
  [tool.tox]
36
36
  legacy_tox_ini = """
37
37
  [tox]
38
- minversion = 3.8
39
- envlist = py{38,39,310,311}
38
+ minversion = 3.7
39
+ envlist = py{37,38,39,310,311}
40
40
 
41
41
  [testenv]
42
42
  deps =
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qase-python-commons
3
- Version: 2.0.9
3
+ Version: 2.0.11
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
7
7
  Classifier: Development Status :: 5 - Production/Stable
8
8
  Classifier: Programming Language :: Python
9
- Requires-Python: >=3.8
9
+ Requires-Python: >=3.7
10
10
  Description-Content-Type: text/markdown
11
11
  License-File: AUTHORS.rst
12
12
  Requires-Dist: certifi>=2024.2.2
13
- Requires-Dist: qaseio<5.0.0,>=4.0.0
13
+ Requires-Dist: qaseio<5.0.0,>=4.0.2
14
14
  Requires-Dist: attrs>=23.2.0
15
15
  Requires-Dist: more_itertools
16
16
  Provides-Extra: testing
@@ -1,5 +1,5 @@
1
1
  certifi>=2024.2.2
2
- qaseio<5.0.0,>=4.0.0
2
+ qaseio<5.0.0,>=4.0.2
3
3
  attrs>=23.2.0
4
4
  more_itertools
5
5
 
@@ -16,23 +16,25 @@ from datetime import datetime
16
16
  import more_itertools
17
17
  import certifi
18
18
 
19
+
19
20
  class TestOpsRunNotFoundException(Exception):
20
21
  pass
21
22
 
23
+
22
24
  class QaseTestOps:
23
25
 
24
26
  def __init__(self,
25
- api_token,
26
- project_code,
27
- run_id=None,
28
- plan_id=None,
29
- bulk=True,
30
- run_title=None,
31
- environment=None,
32
- host="qase.io",
33
- complete_run=False,
34
- defect=False,
35
- chunk_size=200) -> None:
27
+ api_token,
28
+ project_code,
29
+ run_id=None,
30
+ plan_id=None,
31
+ bulk=True,
32
+ run_title=None,
33
+ environment=None,
34
+ host="qase.io",
35
+ complete_run=False,
36
+ defect=False,
37
+ chunk_size=200) -> None:
36
38
 
37
39
  configuration = Configuration()
38
40
  configuration.api_key['TokenAuth'] = api_token
@@ -41,7 +43,7 @@ class QaseTestOps:
41
43
 
42
44
  self.client = ApiClient(configuration)
43
45
 
44
- parseBool = lambda d : d in ("y", "yes", "true", "1", 1, True)
46
+ parseBool = lambda d: d in ("y", "yes", "true", "1", 1, True)
45
47
 
46
48
  self.project_code = project_code
47
49
  self.run_id = int(run_id) if run_id else run_id
@@ -82,7 +84,8 @@ class QaseTestOps:
82
84
  raise ValueError("Unable to find given project code")
83
85
  except ApiException as e:
84
86
  self.enabled = False
85
- print("[Qase] ⚠️ Disabling Qase TestOps reporter. Exception when calling ProjectApi->get_project: %s\n" % e)
87
+ print(
88
+ "[Qase] ⚠️ Disabling Qase TestOps reporter. Exception when calling ProjectApi->get_project: %s\n" % e)
86
89
 
87
90
  # Method loads environment by name and returns environment id
88
91
  def _get_environment(self, environment: str, project: str):
@@ -114,21 +117,22 @@ class QaseTestOps:
114
117
  case_data = {
115
118
  "title": result.get_title(),
116
119
  "description": result.get_field('description'),
117
- "precondtions": result.get_field('precondtions'),
120
+ "preconditions": result.get_field('preconditions'),
118
121
  "postconditions": result.get_field('postconditions'),
119
122
  }
120
123
 
121
124
  for key, param in result.params.items():
122
125
  # Hack to match old TestOps API
123
- if param == "": result.params[key] = "empty"
126
+ if param == "":
127
+ result.params[key] = "empty"
124
128
 
125
- if (result.get_field('severity')):
129
+ if result.get_field('severity'):
126
130
  case_data["severity"] = result.get_field('severity')
127
131
 
128
- if (result.get_field('priority')):
132
+ if result.get_field('priority'):
129
133
  case_data["priority"] = result.get_field('priority')
130
134
 
131
- if (result.get_field('layer')):
135
+ if result.get_field('layer'):
132
136
  case_data["layer"] = result.get_field('layer')
133
137
 
134
138
  if result.get_suite_title():
@@ -148,7 +152,8 @@ class QaseTestOps:
148
152
  })
149
153
 
150
154
  api_results = ResultsApi(self.client)
151
- print(f"[Qase] Sending results to test run {self.run_id}. Total results: {len(results)}. Results in a chunk: {self.chunk_size}.")
155
+ print(
156
+ f"[Qase] Sending results to test run {self.run_id}. Total results: {len(results)}. Results in a chunk: {self.chunk_size}.")
152
157
 
153
158
  i = 1
154
159
 
@@ -163,7 +168,7 @@ class QaseTestOps:
163
168
  )
164
169
  )
165
170
  print(f"[Qase] Chunk #{i} was sent successfully.")
166
- i = i+1
171
+ i = i + 1
167
172
  except Exception as e:
168
173
  print(f"[Qase] ⚠️ Error at sending results for run {self.run_id} (Chunk #{i}): {e}")
169
174
  raise e
@@ -213,11 +218,11 @@ class QaseTestOps:
213
218
  if self.enabled:
214
219
  api_runs = RunsApi(self.client)
215
220
  kwargs = dict(
216
- title=self.run_title,
217
- cases=cases,
218
- environment_id=(int(environment_id) if environment_id else None),
219
- plan_id=(int(plan_id) if plan_id else plan_id),
220
- is_autotest=True
221
+ title=self.run_title,
222
+ cases=cases,
223
+ environment_id=(int(environment_id) if environment_id else None),
224
+ plan_id=(int(plan_id) if plan_id else plan_id),
225
+ is_autotest=True
221
226
  )
222
227
  try:
223
228
  result = api_runs.create_run(
@@ -243,9 +248,9 @@ class QaseTestOps:
243
248
  api_attachments = AttachmentsApi(self.client)
244
249
 
245
250
  return api_attachments.upload_attachment(
246
- self.project_code, file=[attachment.get_for_upload()],
247
- ).result
248
-
251
+ self.project_code, file=[attachment.get_for_upload()],
252
+ ).result
253
+
249
254
  # This method contains a lot of hacks to match old TestOps API.
250
255
  def _prepare_step(self, step: Step):
251
256
  prepared_children = []
@@ -253,26 +258,30 @@ class QaseTestOps:
253
258
  prepared_step = {
254
259
  "time": step.execution.duration,
255
260
  }
256
-
261
+
257
262
  prepared_step["status"] = step.execution.status
258
263
  if step.execution.status == 'untested':
259
264
  prepared_step["status"] = 'passed'
260
-
265
+
261
266
  if step.step_type == "text":
262
267
  prepared_step['action'] = step.data.action
263
268
  if step.data.expected_result:
264
269
  prepared_step['expected_result'] = step.data.expected_result
265
-
270
+
266
271
  if step.step_type == "request":
267
272
  prepared_step['action'] = step.data.request_method + " " + step.data.request_url
268
- if (step.data.request_body):
269
- step.attachments.append(Attachment(file_name='request_body.txt', content=step.data.request_body, mime_type='text/plain'))
270
- if (step.data.request_headers):
271
- step.attachments.append(Attachment(file_name='request_headers.txt', content=step.data.request_headers, mime_type='text/plain'))
272
- if (step.data.response_body):
273
- step.attachments.append(Attachment(file_name='response_body.txt', content=step.data.response_body, mime_type='text/plain'))
274
- if (step.data.response_headers):
275
- step.attachments.append(Attachment(file_name='response_headers.txt', content=step.data.response_headers, mime_type='text/plain'))
273
+ if step.data.request_body:
274
+ step.attachments.append(
275
+ Attachment(file_name='request_body.txt', content=step.data.request_body, mime_type='text/plain'))
276
+ if step.data.request_headers:
277
+ step.attachments.append(Attachment(file_name='request_headers.txt', content=step.data.request_headers,
278
+ mime_type='text/plain'))
279
+ if step.data.response_body:
280
+ step.attachments.append(
281
+ Attachment(file_name='response_body.txt', content=step.data.response_body, mime_type='text/plain'))
282
+ if step.data.response_headers:
283
+ step.attachments.append(Attachment(file_name='response_headers.txt', content=step.data.response_headers,
284
+ mime_type='text/plain'))
276
285
 
277
286
  if step.attachments:
278
287
  uploaded_attachments = []
@@ -305,7 +314,7 @@ class QaseTestOps:
305
314
  case_data = {
306
315
  "title": result.get_title(),
307
316
  "description": result.get_field('description'),
308
- "precondtions": result.get_field('precondtions'),
317
+ "preconditions": result.get_field('preconditions'),
309
318
  "postconditions": result.get_field('postconditions'),
310
319
  }
311
320
 
@@ -314,13 +323,13 @@ class QaseTestOps:
314
323
  if param == "":
315
324
  result.params[key] = "empty"
316
325
 
317
- if (result.get_field('severity')):
326
+ if result.get_field('severity'):
318
327
  case_data["severity"] = result.get_field('severity')
319
328
 
320
- if (result.get_field('priority')):
329
+ if result.get_field('priority'):
321
330
  case_data["priority"] = result.get_field('priority')
322
331
 
323
- if (result.get_field('layer')):
332
+ if result.get_field('layer'):
324
333
  case_data["layer"] = result.get_field('layer')
325
334
 
326
335
  if result.get_suite_title():
@@ -336,7 +345,7 @@ class QaseTestOps:
336
345
  stacktrace=result.execution.stacktrace,
337
346
  time_ms=result.execution.duration,
338
347
  comment=result.message,
339
- attachments = [attach.hash for attach in attached],
348
+ attachments=[attach.hash for attach in attached],
340
349
  defect=self.defect,
341
350
  case=ResultCreateCase(
342
351
  **{k: v for k, v in case_data.items() if v is not None}