qase-python-commons 3.1.9__tar.gz → 3.2.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.
Potentially problematic release.
This version of qase-python-commons might be problematic. Click here for more details.
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/PKG-INFO +2 -2
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/pyproject.toml +2 -2
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/client/api_v1_client.py +8 -2
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/client/api_v2_client.py +8 -6
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/__init__.py +0 -2
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/testops.py +1 -1
- qase_python_commons-3.2.1/src/qase/commons/models/relation.py +23 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/result.py +3 -18
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/reporters/report.py +7 -1
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase_python_commons.egg-info/PKG-INFO +2 -2
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase_python_commons.egg-info/SOURCES.txt +0 -1
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase_python_commons.egg-info/requires.txt +1 -1
- qase_python_commons-3.1.9/src/qase/commons/models/relation.py +0 -13
- qase_python_commons-3.1.9/src/qase/commons/models/suite.py +0 -13
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/README.md +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/setup.cfg +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/__init__.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/client/base_api_client.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/config.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/exceptions/reporter.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/loader.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/logger.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/attachment.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/basemodel.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/api.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/batch.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/connection.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/framework.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/plan.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/qaseconfig.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/report.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/run.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/run.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/runtime.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/step.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/profilers/__init__.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/profilers/db.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/profilers/network.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/profilers/sleep.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/reporters/__init__.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/reporters/core.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/reporters/testops.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/utils.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/validators/base.py +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase_python_commons.egg-info/dependency_links.txt +0 -0
- {qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase_python_commons.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qase-python-commons
|
|
3
|
-
Version: 3.1
|
|
3
|
+
Version: 3.2.1
|
|
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
|
|
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
|
|
|
23
23
|
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
|
-
Requires-Dist: qase-api-v2-client~=1.
|
|
26
|
+
Requires-Dist: qase-api-v2-client~=1.1.0
|
|
27
27
|
Requires-Dist: more_itertools
|
|
28
28
|
Provides-Extra: testing
|
|
29
29
|
Requires-Dist: pytest; extra == "testing"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qase-python-commons"
|
|
7
|
-
version = "3.1
|
|
7
|
+
version = "3.2.1"
|
|
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"}]
|
|
@@ -31,7 +31,7 @@ dependencies = [
|
|
|
31
31
|
"certifi>=2024.2.2",
|
|
32
32
|
"attrs>=23.2.0",
|
|
33
33
|
"qase-api-client~=1.1.1",
|
|
34
|
-
"qase-api-v2-client~=1.
|
|
34
|
+
"qase-api-v2-client~=1.1.0",
|
|
35
35
|
"more_itertools"
|
|
36
36
|
]
|
|
37
37
|
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/client/api_v1_client.py
RENAMED
|
@@ -171,8 +171,14 @@ class ApiV1Client(BaseApiClient):
|
|
|
171
171
|
case_data["layer"] = result.get_field('layer')
|
|
172
172
|
|
|
173
173
|
suite = None
|
|
174
|
-
if result.
|
|
175
|
-
|
|
174
|
+
if result.relations is not None and result.relations.suite is not None and len(
|
|
175
|
+
result.relations.suite.data) != 0:
|
|
176
|
+
suites = []
|
|
177
|
+
|
|
178
|
+
for raw in result.relations.suite.data:
|
|
179
|
+
suites.append(raw.title)
|
|
180
|
+
|
|
181
|
+
suite = "\t".join(suites)
|
|
176
182
|
|
|
177
183
|
if result.get_field('suite'):
|
|
178
184
|
suite = result.get_field('suite')
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/client/api_v2_client.py
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Dict
|
|
2
2
|
|
|
3
3
|
import certifi
|
|
4
|
-
from qase.api_client_v2 import ResultsApi
|
|
4
|
+
from qase.api_client_v2 import ResultsApi, ResultCreateFields
|
|
5
5
|
from qase.api_client_v2.api_client import ApiClient
|
|
6
6
|
from qase.api_client_v2.configuration import Configuration
|
|
7
7
|
from qase.api_client_v2.models.create_results_request_v2 import CreateResultsRequestV2
|
|
@@ -75,23 +75,25 @@ class ApiV2Client(ApiV1Client):
|
|
|
75
75
|
execution=ResultExecution(start_time=result.execution.start_time, end_time=result.execution.end_time,
|
|
76
76
|
status=result.execution.status, duration=result.execution.duration,
|
|
77
77
|
stacktrace=result.execution.stacktrace, thread=result.execution.thread),
|
|
78
|
-
fields=result.fields,
|
|
78
|
+
fields=ResultCreateFields.from_dict(result.fields),
|
|
79
79
|
attachments=[attach.hash for attach in attached],
|
|
80
80
|
steps=steps,
|
|
81
|
-
|
|
81
|
+
steps_type=ResultStepsType.CLASSIC,
|
|
82
82
|
params=result.params,
|
|
83
|
+
param_groups=result.param_groups,
|
|
83
84
|
muted=False,
|
|
84
85
|
message=result.message,
|
|
85
86
|
)
|
|
86
87
|
|
|
87
|
-
if result.
|
|
88
|
+
if result.relations is not None and result.relations.suite is not None and len(
|
|
89
|
+
result.relations.suite.data) != 0:
|
|
88
90
|
data = []
|
|
89
91
|
root_suite = self.config.root_suite
|
|
90
92
|
if root_suite:
|
|
91
93
|
data.append(RelationSuiteItem(title=root_suite))
|
|
92
94
|
|
|
93
|
-
for
|
|
94
|
-
data.append(RelationSuiteItem(title=
|
|
95
|
+
for raw in result.relations.suite.data:
|
|
96
|
+
data.append(RelationSuiteItem(title=raw.title))
|
|
95
97
|
|
|
96
98
|
result_model_v2.relations = ResultRelations(suite=RelationSuite(data=data))
|
|
97
99
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from .result import Result, Field
|
|
2
2
|
from .run import Run
|
|
3
3
|
from .attachment import Attachment
|
|
4
|
-
from .suite import Suite
|
|
5
4
|
from .relation import Relation
|
|
6
5
|
from .step import Step
|
|
7
6
|
from .runtime import Runtime
|
|
@@ -10,7 +9,6 @@ __all__ = [
|
|
|
10
9
|
Result,
|
|
11
10
|
Run,
|
|
12
11
|
Attachment,
|
|
13
|
-
Suite,
|
|
14
12
|
Relation,
|
|
15
13
|
Step,
|
|
16
14
|
Runtime,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .basemodel import BaseModel
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class SuiteData(BaseModel):
|
|
5
|
+
def __init__(self, title: str) -> None:
|
|
6
|
+
self.public_id = None
|
|
7
|
+
self.title = title
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RelationSuite(BaseModel):
|
|
11
|
+
def __init__(self) -> None:
|
|
12
|
+
self.data = []
|
|
13
|
+
|
|
14
|
+
def add_data(self, data: SuiteData) -> None:
|
|
15
|
+
self.data.append(data)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Relation(BaseModel):
|
|
19
|
+
def __init__(self):
|
|
20
|
+
self.suite = RelationSuite()
|
|
21
|
+
|
|
22
|
+
def add_suite(self, suite: SuiteData) -> None:
|
|
23
|
+
self.suite.add_data(suite)
|
|
@@ -4,7 +4,6 @@ import uuid
|
|
|
4
4
|
from typing import Type, Optional, Union, Dict, List
|
|
5
5
|
from .basemodel import BaseModel
|
|
6
6
|
from .step import Step
|
|
7
|
-
from .suite import Suite
|
|
8
7
|
from .attachment import Attachment
|
|
9
8
|
from .relation import Relation
|
|
10
9
|
from .. import QaseUtils
|
|
@@ -79,10 +78,9 @@ class Result(BaseModel):
|
|
|
79
78
|
self.params: Optional[dict] = {}
|
|
80
79
|
self.param_groups: Optional[List[List[str]]] = []
|
|
81
80
|
self.author: Optional[str] = None
|
|
82
|
-
self.relations:
|
|
81
|
+
self.relations: Type[Relation] = None
|
|
83
82
|
self.muted: bool = False
|
|
84
83
|
self.message: Optional[str] = None
|
|
85
|
-
self.suite: Optional[Type[Suite]] = None
|
|
86
84
|
QaseUtils.get_host_data()
|
|
87
85
|
|
|
88
86
|
def add_message(self, message: str) -> None:
|
|
@@ -97,20 +95,14 @@ class Result(BaseModel):
|
|
|
97
95
|
def add_attachment(self, attachment: Attachment) -> None:
|
|
98
96
|
self.attachments.append(attachment)
|
|
99
97
|
|
|
100
|
-
def add_relation(self, relation: Type[Relation]) -> None:
|
|
101
|
-
self.relations.append(relation)
|
|
102
|
-
|
|
103
98
|
def add_param(self, key: str, value: str) -> None:
|
|
104
99
|
self.params[key] = value
|
|
105
100
|
|
|
106
101
|
def add_param_groups(self, values: List[str]) -> None:
|
|
107
102
|
self.param_groups.append(values)
|
|
108
103
|
|
|
109
|
-
def
|
|
110
|
-
self.relations
|
|
111
|
-
|
|
112
|
-
def add_suite(self, suite: Type[Suite]) -> None:
|
|
113
|
-
self.suite = suite
|
|
104
|
+
def set_relation(self, relation: Relation) -> None:
|
|
105
|
+
self.relations = relation
|
|
114
106
|
|
|
115
107
|
def get_status(self) -> Optional[str]:
|
|
116
108
|
return self.execution.status
|
|
@@ -127,17 +119,10 @@ class Result(BaseModel):
|
|
|
127
119
|
return None
|
|
128
120
|
|
|
129
121
|
def get_testops_id(self) -> Optional[int]:
|
|
130
|
-
if self.testops_id is None:
|
|
131
|
-
# Hack for old API
|
|
132
|
-
return 0
|
|
133
122
|
return self.testops_id
|
|
134
123
|
|
|
135
124
|
def get_duration(self) -> int:
|
|
136
125
|
return self.execution.duration
|
|
137
126
|
|
|
138
|
-
def get_suite_title(self) -> Optional[str]:
|
|
139
|
-
if self.suite:
|
|
140
|
-
return self.suite.title
|
|
141
|
-
|
|
142
127
|
def set_run_id(self, run_id: str) -> None:
|
|
143
128
|
self.run_id = run_id
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/reporters/report.py
RENAMED
|
@@ -68,13 +68,19 @@ class QaseReport:
|
|
|
68
68
|
mode = "w"
|
|
69
69
|
if isinstance(attachment.content, bytes):
|
|
70
70
|
mode = "wb"
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
file_path = f"{self.report_path}/attachments/{attachment.id}-{attachment.file_name}"
|
|
73
|
+
with open(file_path, mode) as f:
|
|
72
74
|
f.write(attachment.content)
|
|
73
75
|
# Clear content to save memory and avoid double writing
|
|
74
76
|
attachment.content = None
|
|
77
|
+
attachment.file_path = file_path
|
|
78
|
+
|
|
75
79
|
elif attachment.file_path:
|
|
80
|
+
file_path = f"{self.report_path}/attachments/{attachment.id}-{attachment.file_name}"
|
|
76
81
|
shutil.copy2(os.path.abspath(attachment.file_path),
|
|
77
82
|
f"{self.report_path}/attachments/{attachment.id}-{attachment.file_name}")
|
|
83
|
+
attachment.file_path = file_path
|
|
78
84
|
|
|
79
85
|
def _persist_attachments_in_steps(self, steps: list):
|
|
80
86
|
for step in steps:
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase_python_commons.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qase-python-commons
|
|
3
|
-
Version: 3.1
|
|
3
|
+
Version: 3.2.1
|
|
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
|
|
@@ -23,7 +23,7 @@ Description-Content-Type: text/markdown
|
|
|
23
23
|
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
|
-
Requires-Dist: qase-api-v2-client~=1.
|
|
26
|
+
Requires-Dist: qase-api-v2-client~=1.1.0
|
|
27
27
|
Requires-Dist: more_itertools
|
|
28
28
|
Provides-Extra: testing
|
|
29
29
|
Requires-Dist: pytest; extra == "testing"
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase_python_commons.egg-info/SOURCES.txt
RENAMED
|
@@ -17,7 +17,6 @@ src/qase/commons/models/result.py
|
|
|
17
17
|
src/qase/commons/models/run.py
|
|
18
18
|
src/qase/commons/models/runtime.py
|
|
19
19
|
src/qase/commons/models/step.py
|
|
20
|
-
src/qase/commons/models/suite.py
|
|
21
20
|
src/qase/commons/models/config/api.py
|
|
22
21
|
src/qase/commons/models/config/batch.py
|
|
23
22
|
src/qase/commons/models/config/connection.py
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from .basemodel import BaseModel
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class RelationSuite(BaseModel):
|
|
5
|
-
def __init__(self, suite_id: int, title: str) -> None:
|
|
6
|
-
self.suite_id = suite_id
|
|
7
|
-
self.title = title
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Relation(BaseModel):
|
|
11
|
-
def __init__(self, type: str, data: RelationSuite):
|
|
12
|
-
self.type = type
|
|
13
|
-
self.data = data
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import uuid
|
|
2
|
-
|
|
3
|
-
from typing import List, Optional
|
|
4
|
-
|
|
5
|
-
from .basemodel import BaseModel
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Suite(BaseModel):
|
|
9
|
-
def __init__(self, title: str, description: Optional[str] = None, parent_id: Optional[str] = None):
|
|
10
|
-
self.title = title
|
|
11
|
-
self.description = description
|
|
12
|
-
self.parent_id = parent_id
|
|
13
|
-
self.id = str(uuid.uuid4())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/client/base_api_client.py
RENAMED
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/exceptions/reporter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/attachment.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/basemodel.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/api.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/batch.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/connection.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/framework.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/plan.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/qaseconfig.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/report.py
RENAMED
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/models/config/run.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/profilers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/profilers/network.py
RENAMED
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/reporters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.1.9 → qase_python_commons-3.2.1}/src/qase/commons/reporters/testops.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|