qase-python-commons 3.0.2b3__tar.gz → 3.0.2b5__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.
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/PKG-INFO +1 -1
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/pyproject.toml +1 -1
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/profilers/network.py +25 -10
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/profilers/sleep.py +2 -2
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/reporters/core.py +2 -1
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase_python_commons.egg-info/PKG-INFO +1 -1
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/README.md +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/setup.cfg +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/__init__.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/client/api_v1_client.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/client/api_v2_client.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/client/base_api_client.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/config.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/exceptions/reporter.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/loader.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/logger.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/__init__.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/attachment.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/basemodel.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/relation.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/result.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/run.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/runtime.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/step.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/suite.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/profilers/__init__.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/profilers/db.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/reporters/__init__.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/reporters/report.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/reporters/testops.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/utils.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/validators/base.py +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase_python_commons.egg-info/SOURCES.txt +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase_python_commons.egg-info/dependency_links.txt +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase_python_commons.egg-info/requires.txt +0 -0
- {qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/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.0.
|
|
3
|
+
Version: 3.0.2b5
|
|
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
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qase-python-commons"
|
|
7
|
-
version = "3.0.
|
|
7
|
+
version = "3.0.2b5"
|
|
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"}]
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/profilers/network.py
RENAMED
|
@@ -8,9 +8,10 @@ from ..models.step import Step, StepRequestData, StepType
|
|
|
8
8
|
class NetworkProfiler:
|
|
9
9
|
_instance = None
|
|
10
10
|
|
|
11
|
-
def __init__(self, runtime: Runtime, track_on_fail: bool = True):
|
|
11
|
+
def __init__(self, runtime: Runtime, skip_domain: str, track_on_fail: bool = True):
|
|
12
12
|
self._original_functions = {}
|
|
13
13
|
self.runtime = runtime
|
|
14
|
+
self.skip_domain = skip_domain
|
|
14
15
|
self.track_on_fail = track_on_fail
|
|
15
16
|
self.step = None
|
|
16
17
|
|
|
@@ -37,46 +38,60 @@ class NetworkProfiler:
|
|
|
37
38
|
def _requests_send_wrapper(self, func):
|
|
38
39
|
@wraps(func)
|
|
39
40
|
def wrapper(self, request, *args, **kwargs):
|
|
40
|
-
NetworkProfilerSingleton.get_instance().
|
|
41
|
+
NetworkProfilerSingleton.get_instance()._log_request(request)
|
|
41
42
|
response = func(self, request, *args, **kwargs)
|
|
42
|
-
NetworkProfilerSingleton.get_instance().
|
|
43
|
+
NetworkProfilerSingleton.get_instance()._log_response(response)
|
|
43
44
|
return response
|
|
44
45
|
|
|
45
46
|
return wrapper
|
|
46
47
|
|
|
47
48
|
def _urllib3_request_wrapper(self, func):
|
|
49
|
+
skip_domain = self.skip_domain
|
|
50
|
+
|
|
48
51
|
@wraps(func)
|
|
49
52
|
def wrapper(self, method, url, *args, **kwargs):
|
|
53
|
+
if skip_domain in url:
|
|
54
|
+
return func(self, method, url, *args, **kwargs)
|
|
55
|
+
|
|
50
56
|
interceptor = NetworkProfilerSingleton.get_instance()
|
|
51
57
|
request = lambda: None
|
|
52
58
|
request.method = method
|
|
53
59
|
request.url = url
|
|
54
60
|
|
|
55
|
-
interceptor.
|
|
61
|
+
interceptor._log_request(request)
|
|
56
62
|
response = func(self, method, url, *args, **kwargs)
|
|
57
|
-
|
|
58
|
-
interceptor._log_post_response(response, url=url)
|
|
63
|
+
interceptor._log_response(response, url=url)
|
|
59
64
|
return response
|
|
60
65
|
|
|
61
66
|
return wrapper
|
|
62
67
|
|
|
63
68
|
@staticmethod
|
|
64
|
-
def
|
|
69
|
+
def _log_request(request):
|
|
65
70
|
NetworkProfilerSingleton.get_instance().step = Step(
|
|
66
71
|
id=str(uuid.uuid4()),
|
|
67
72
|
step_type=StepType.REQUEST,
|
|
68
73
|
data=StepRequestData(
|
|
69
74
|
request_method=request.method,
|
|
70
75
|
request_url=request.url,
|
|
71
|
-
request_body=request.body,
|
|
72
|
-
request_headers=request.headers,
|
|
76
|
+
request_body=request.body if hasattr(request, 'body') else None,
|
|
77
|
+
request_headers=request.headers if hasattr(request, 'headers') else None
|
|
73
78
|
),
|
|
74
79
|
)
|
|
75
80
|
|
|
76
81
|
@staticmethod
|
|
77
|
-
def
|
|
82
|
+
def _log_response(response, url=None, *args, **kwargs):
|
|
78
83
|
status = response.status if hasattr(response, 'status') else response.status_code
|
|
79
84
|
profiler = NetworkProfilerSingleton.get_instance()
|
|
85
|
+
if profiler.step is None:
|
|
86
|
+
profiler.step = Step(
|
|
87
|
+
id=str(uuid.uuid4()),
|
|
88
|
+
step_type=StepType.REQUEST,
|
|
89
|
+
data=StepRequestData(
|
|
90
|
+
request_method=response.request.method,
|
|
91
|
+
request_url=response.request.url,
|
|
92
|
+
request_body=response.request.body if hasattr(response.request, 'body') else None,
|
|
93
|
+
request_headers=response.request.headers if hasattr(response.request, 'headers') else None
|
|
94
|
+
))
|
|
80
95
|
profiler.step.data.add_response(
|
|
81
96
|
status_code=status,
|
|
82
97
|
response_body=str(response.data if hasattr(response,
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/profilers/sleep.py
RENAMED
|
@@ -30,7 +30,7 @@ class SleepProfiler:
|
|
|
30
30
|
def wrapper(duration, *args, **kwargs):
|
|
31
31
|
self._log_pre_sleep(duration)
|
|
32
32
|
func(duration, *args, **kwargs)
|
|
33
|
-
self._log_post_sleep(
|
|
33
|
+
self._log_post_sleep()
|
|
34
34
|
|
|
35
35
|
return wrapper
|
|
36
36
|
|
|
@@ -44,7 +44,7 @@ class SleepProfiler:
|
|
|
44
44
|
# Assuming runtime can start a step without a request/response
|
|
45
45
|
self.runtime.add_step(self.step)
|
|
46
46
|
|
|
47
|
-
def _log_post_sleep(self
|
|
47
|
+
def _log_post_sleep(self):
|
|
48
48
|
# Log or track the post-sleep call
|
|
49
49
|
# Update the step status to passed as sleep doesn't fail like network calls
|
|
50
50
|
self.runtime.finish_step(
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/reporters/core.py
RENAMED
|
@@ -109,7 +109,8 @@ class QaseCoreReporter:
|
|
|
109
109
|
if profiler == "network":
|
|
110
110
|
# Lazy import
|
|
111
111
|
from ..profilers import NetworkProfilerSingleton
|
|
112
|
-
NetworkProfilerSingleton.init(runtime=runtime
|
|
112
|
+
NetworkProfilerSingleton.init(runtime=runtime,
|
|
113
|
+
skip_domain=self.config.get("testops.api.host", "qase.io"))
|
|
113
114
|
self.profilers.append(NetworkProfilerSingleton.get_instance())
|
|
114
115
|
if profiler == "sleep":
|
|
115
116
|
from ..profilers import SleepProfiler
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: qase-python-commons
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.2b5
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/client/api_v1_client.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/client/api_v2_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/exceptions/reporter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/__init__.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/attachment.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/basemodel.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/relation.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/result.py
RENAMED
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/runtime.py
RENAMED
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/models/suite.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/profilers/__init__.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/profilers/db.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/reporters/__init__.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/reporters/report.py
RENAMED
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/reporters/testops.py
RENAMED
|
File without changes
|
|
File without changes
|
{qase_python_commons-3.0.2b3 → qase_python_commons-3.0.2b5}/src/qase/commons/validators/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|