testit-python-commons 3.10.4.post550__tar.gz → 3.10.5__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.
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/PKG-INFO +2 -2
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/setup.py +2 -2
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/api_client.py +1 -16
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/link.py +3 -2
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/step_result.py +7 -4
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/test_result.py +13 -12
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/test_result_with_all_fixture_step_results_model.py +1 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/utils/html_escape_utils.py +4 -4
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons.egg-info/PKG-INFO +2 -2
- testit_python_commons-3.10.5/src/testit_python_commons.egg-info/requires.txt +3 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/tests/test_html_escape_utils.py +13 -13
- testit_python_commons-3.10.4.post550/src/testit_python_commons.egg-info/requires.txt +0 -3
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/README.md +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/setup.cfg +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/__init__.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/app_properties.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/__init__.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/client_configuration.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/converter.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/helpers/__init__.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/helpers/bulk_autotest_helper.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/helpers/threads_manager.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/models/__init__.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/models/threads_for_create_and_result.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/client/models/threads_for_update_and_result.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/decorators.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/dynamic_methods.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/__init__.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/adapter_mode.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/fixture.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/link_type.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/models/outcome_type.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/__init__.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/adapter_manager.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/adapter_manager_configuration.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/fixture_manager.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/fixture_storage.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/logger.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/plugin_manager.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/retry.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/step_manager.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/step_result_storage.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/services/utils.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/step.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons/utils/__init__.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons.egg-info/SOURCES.txt +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons.egg-info/dependency_links.txt +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/src/testit_python_commons.egg-info/top_level.txt +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/tests/test_app_properties.py +0 -0
- {testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/tests/test_dynamic_methods.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: testit-python-commons
|
|
3
|
-
Version: 3.10.
|
|
3
|
+
Version: 3.10.5
|
|
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
|
|
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.
|
|
3
|
+
VERSION = "3.10.5"
|
|
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']
|
|
29
29
|
)
|
|
@@ -23,8 +23,7 @@ from testit_python_commons.client.helpers.bulk_autotest_helper import BulkAutote
|
|
|
23
23
|
from testit_python_commons.models.test_result import TestResult
|
|
24
24
|
from testit_python_commons.services.logger import adapter_logger
|
|
25
25
|
from testit_python_commons.services.retry import retry
|
|
26
|
-
from
|
|
27
|
-
from typing import List, Any
|
|
26
|
+
from typing import List
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
class ApiClientWorker:
|
|
@@ -61,11 +60,6 @@ class ApiClientWorker:
|
|
|
61
60
|
header_name='Authorization',
|
|
62
61
|
header_value='PrivateToken ' + token)
|
|
63
62
|
|
|
64
|
-
@staticmethod
|
|
65
|
-
def _escape_html_in_model(model: Any) -> Any:
|
|
66
|
-
"""Apply HTML escaping to all models before sending to API"""
|
|
67
|
-
return HtmlEscapeUtils.escape_html_in_object(model)
|
|
68
|
-
|
|
69
63
|
@adapter_logger
|
|
70
64
|
def create_test_run(self, test_run_name: str = None) -> str:
|
|
71
65
|
test_run_name = f'TestRun_{datetime.today().strftime("%Y-%m-%dT%H:%M:%S")}' if \
|
|
@@ -74,7 +68,6 @@ class ApiClientWorker:
|
|
|
74
68
|
self.__config.get_project_id(),
|
|
75
69
|
test_run_name
|
|
76
70
|
)
|
|
77
|
-
model = self._escape_html_in_model(model)
|
|
78
71
|
|
|
79
72
|
response = self.__test_run_api.create_empty(create_empty_request=model)
|
|
80
73
|
|
|
@@ -95,7 +88,6 @@ class ApiClientWorker:
|
|
|
95
88
|
def update_test_run(self, test_run: TestRunV2ApiResult) -> None:
|
|
96
89
|
"""Function updates test run."""
|
|
97
90
|
model = Converter.build_update_empty_request(test_run)
|
|
98
|
-
model = HtmlEscapeUtils.escape_html_in_object(model)
|
|
99
91
|
logging.debug(f"Updating test run with model: {model}")
|
|
100
92
|
|
|
101
93
|
self.__test_run_api.update_empty(update_empty_request=model)
|
|
@@ -321,7 +313,6 @@ class ApiClientWorker:
|
|
|
321
313
|
test_result,
|
|
322
314
|
self.__config.get_project_id(),
|
|
323
315
|
work_item_ids_for_link_with_auto_test)
|
|
324
|
-
model = self._escape_html_in_model(model)
|
|
325
316
|
|
|
326
317
|
autotest_response = self.__autotest_api.create_auto_test(create_auto_test_request=model)
|
|
327
318
|
|
|
@@ -333,7 +324,6 @@ class ApiClientWorker:
|
|
|
333
324
|
def __create_tests(self, autotests_for_create: List[AutoTestPostModel]) -> None:
|
|
334
325
|
logging.debug(f'Creating autotests: "{autotests_for_create}')
|
|
335
326
|
|
|
336
|
-
autotests_for_create = self._escape_html_in_model(autotests_for_create)
|
|
337
327
|
self.__autotest_api.create_multiple(auto_test_post_model=autotests_for_create)
|
|
338
328
|
|
|
339
329
|
logging.debug(f'Autotests were created')
|
|
@@ -343,7 +333,6 @@ class ApiClientWorker:
|
|
|
343
333
|
logging.debug(f'Autotest "{test_result.get_autotest_name()}" was found')
|
|
344
334
|
|
|
345
335
|
model = Converter.prepare_to_update_autotest(test_result, autotest, self.__config.get_project_id())
|
|
346
|
-
model = self._escape_html_in_model(model)
|
|
347
336
|
|
|
348
337
|
try:
|
|
349
338
|
self.__autotest_api.update_auto_test(update_auto_test_request=model)
|
|
@@ -356,7 +345,6 @@ class ApiClientWorker:
|
|
|
356
345
|
def __update_tests(self, autotests_for_update: List[AutoTestPutModel]) -> None:
|
|
357
346
|
logging.debug(f'Updating autotests: {autotests_for_update}')
|
|
358
347
|
|
|
359
|
-
autotests_for_update = self._escape_html_in_model(autotests_for_update)
|
|
360
348
|
self.__autotest_api.update_multiple(auto_test_put_model=autotests_for_update)
|
|
361
349
|
|
|
362
350
|
logging.debug(f'Autotests were updated')
|
|
@@ -384,7 +372,6 @@ class ApiClientWorker:
|
|
|
384
372
|
model = Converter.test_result_to_testrun_result_post_model(
|
|
385
373
|
test_result,
|
|
386
374
|
self.__config.get_configuration_id())
|
|
387
|
-
model = self._escape_html_in_model(model)
|
|
388
375
|
|
|
389
376
|
response = self.__test_run_api.set_auto_test_results_for_test_run(
|
|
390
377
|
id=self.__config.get_test_run_id(),
|
|
@@ -412,8 +399,6 @@ class ApiClientWorker:
|
|
|
412
399
|
test_result.get_setup_results())
|
|
413
400
|
model.teardown_results = Converter.step_results_to_auto_test_step_result_update_request(
|
|
414
401
|
test_result.get_teardown_results())
|
|
415
|
-
|
|
416
|
-
model = self._escape_html_in_model(model)
|
|
417
402
|
|
|
418
403
|
try:
|
|
419
404
|
self.__test_results_api.api_v2_test_results_id_put(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from testit_python_commons.models.link_type import LinkType
|
|
2
2
|
from testit_python_commons.services.logger import adapter_logger
|
|
3
|
+
from testit_python_commons.utils import HtmlEscapeUtils
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class Link:
|
|
@@ -20,7 +21,7 @@ class Link:
|
|
|
20
21
|
|
|
21
22
|
@adapter_logger
|
|
22
23
|
def set_title(self, title: str):
|
|
23
|
-
self.__title = title
|
|
24
|
+
self.__title = HtmlEscapeUtils.escape_html_tags(title)
|
|
24
25
|
|
|
25
26
|
return self
|
|
26
27
|
|
|
@@ -40,7 +41,7 @@ class Link:
|
|
|
40
41
|
|
|
41
42
|
@adapter_logger
|
|
42
43
|
def set_description(self, description: str):
|
|
43
|
-
self.__description = description
|
|
44
|
+
self.__description = HtmlEscapeUtils.escape_html_tags(description)
|
|
44
45
|
|
|
45
46
|
return self
|
|
46
47
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from testit_python_commons.utils.html_escape_utils import HtmlEscapeUtils
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
class StepResult:
|
|
2
5
|
__title: str = None
|
|
3
6
|
__outcome: str = None
|
|
@@ -15,7 +18,7 @@ class StepResult:
|
|
|
15
18
|
self.__parameters = {}
|
|
16
19
|
|
|
17
20
|
def set_title(self, title: str):
|
|
18
|
-
self.__title = title
|
|
21
|
+
self.__title = HtmlEscapeUtils.escape_html_tags(title)
|
|
19
22
|
|
|
20
23
|
return self
|
|
21
24
|
|
|
@@ -23,7 +26,7 @@ class StepResult:
|
|
|
23
26
|
return self.__title
|
|
24
27
|
|
|
25
28
|
def set_outcome(self, outcome: str):
|
|
26
|
-
self.__outcome = outcome
|
|
29
|
+
self.__outcome = HtmlEscapeUtils.escape_html_tags(outcome)
|
|
27
30
|
|
|
28
31
|
return self
|
|
29
32
|
|
|
@@ -31,7 +34,7 @@ class StepResult:
|
|
|
31
34
|
return self.__outcome
|
|
32
35
|
|
|
33
36
|
def set_description(self, description: str):
|
|
34
|
-
self.__description = description
|
|
37
|
+
self.__description = HtmlEscapeUtils.escape_html_tags(description)
|
|
35
38
|
|
|
36
39
|
return self
|
|
37
40
|
|
|
@@ -79,7 +82,7 @@ class StepResult:
|
|
|
79
82
|
return self.__attachments
|
|
80
83
|
|
|
81
84
|
def set_parameters(self, parameters: dict):
|
|
82
|
-
self.__parameters = parameters
|
|
85
|
+
self.__parameters = HtmlEscapeUtils.escape_html_in_object(parameters)
|
|
83
86
|
|
|
84
87
|
return self
|
|
85
88
|
|
|
@@ -3,6 +3,7 @@ from typing import List
|
|
|
3
3
|
from testit_python_commons.models.link import Link
|
|
4
4
|
from testit_python_commons.models.step_result import StepResult
|
|
5
5
|
from testit_python_commons.services.logger import adapter_logger
|
|
6
|
+
from testit_python_commons.utils import HtmlEscapeUtils
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class TestResult:
|
|
@@ -33,7 +34,7 @@ class TestResult:
|
|
|
33
34
|
|
|
34
35
|
@adapter_logger
|
|
35
36
|
def set_external_id(self, external_id: str):
|
|
36
|
-
self.__external_id = external_id
|
|
37
|
+
self.__external_id = HtmlEscapeUtils.escape_html_tags(external_id)
|
|
37
38
|
|
|
38
39
|
return self
|
|
39
40
|
|
|
@@ -43,7 +44,7 @@ class TestResult:
|
|
|
43
44
|
|
|
44
45
|
@adapter_logger
|
|
45
46
|
def set_autotest_name(self, autotest_name: str):
|
|
46
|
-
self.__autotest_name = autotest_name
|
|
47
|
+
self.__autotest_name = HtmlEscapeUtils.escape_html_tags(autotest_name)
|
|
47
48
|
|
|
48
49
|
return self
|
|
49
50
|
|
|
@@ -53,7 +54,7 @@ class TestResult:
|
|
|
53
54
|
|
|
54
55
|
@adapter_logger
|
|
55
56
|
def set_outcome(self, outcome: str):
|
|
56
|
-
self.__outcome = outcome
|
|
57
|
+
self.__outcome = HtmlEscapeUtils.escape_html_tags(outcome)
|
|
57
58
|
|
|
58
59
|
return self
|
|
59
60
|
|
|
@@ -63,7 +64,7 @@ class TestResult:
|
|
|
63
64
|
|
|
64
65
|
@adapter_logger
|
|
65
66
|
def set_title(self, title: str):
|
|
66
|
-
self.__title = title
|
|
67
|
+
self.__title = HtmlEscapeUtils.escape_html_tags(title)
|
|
67
68
|
|
|
68
69
|
return self
|
|
69
70
|
|
|
@@ -73,7 +74,7 @@ class TestResult:
|
|
|
73
74
|
|
|
74
75
|
@adapter_logger
|
|
75
76
|
def set_description(self, description: str):
|
|
76
|
-
self.__description = description
|
|
77
|
+
self.__description = HtmlEscapeUtils.escape_html_tags(description)
|
|
77
78
|
|
|
78
79
|
return self
|
|
79
80
|
|
|
@@ -113,7 +114,7 @@ class TestResult:
|
|
|
113
114
|
|
|
114
115
|
@adapter_logger
|
|
115
116
|
def set_namespace(self, namespace: str):
|
|
116
|
-
self.__namespace = namespace
|
|
117
|
+
self.__namespace = HtmlEscapeUtils.escape_html_tags(namespace)
|
|
117
118
|
|
|
118
119
|
return self
|
|
119
120
|
|
|
@@ -123,7 +124,7 @@ class TestResult:
|
|
|
123
124
|
|
|
124
125
|
@adapter_logger
|
|
125
126
|
def set_classname(self, classname: str):
|
|
126
|
-
self.__classname = classname
|
|
127
|
+
self.__classname = HtmlEscapeUtils.escape_html_tags(classname)
|
|
127
128
|
|
|
128
129
|
return self
|
|
129
130
|
|
|
@@ -133,7 +134,7 @@ class TestResult:
|
|
|
133
134
|
|
|
134
135
|
@adapter_logger
|
|
135
136
|
def set_message(self, message: str):
|
|
136
|
-
self.__message = message
|
|
137
|
+
self.__message = HtmlEscapeUtils.escape_html_tags(message)
|
|
137
138
|
|
|
138
139
|
return self
|
|
139
140
|
|
|
@@ -143,7 +144,7 @@ class TestResult:
|
|
|
143
144
|
|
|
144
145
|
@adapter_logger
|
|
145
146
|
def set_traces(self, traces: str):
|
|
146
|
-
self.__traces = traces
|
|
147
|
+
self.__traces = HtmlEscapeUtils.escape_html_tags(traces)
|
|
147
148
|
|
|
148
149
|
return self
|
|
149
150
|
|
|
@@ -213,7 +214,7 @@ class TestResult:
|
|
|
213
214
|
|
|
214
215
|
@adapter_logger
|
|
215
216
|
def set_labels(self, labels: list):
|
|
216
|
-
self.__labels = labels
|
|
217
|
+
self.__labels = HtmlEscapeUtils.escape_html_in_object(labels)
|
|
217
218
|
|
|
218
219
|
return self
|
|
219
220
|
|
|
@@ -233,7 +234,7 @@ class TestResult:
|
|
|
233
234
|
|
|
234
235
|
@adapter_logger
|
|
235
236
|
def set_parameters(self, parameters: dict):
|
|
236
|
-
self.__parameters = parameters
|
|
237
|
+
self.__parameters = HtmlEscapeUtils.escape_html_in_object(parameters)
|
|
237
238
|
|
|
238
239
|
return self
|
|
239
240
|
|
|
@@ -243,7 +244,7 @@ class TestResult:
|
|
|
243
244
|
|
|
244
245
|
@adapter_logger
|
|
245
246
|
def set_properties(self, properties: dict):
|
|
246
|
-
self.__properties = properties
|
|
247
|
+
self.__properties = HtmlEscapeUtils.escape_html_in_object(properties)
|
|
247
248
|
|
|
248
249
|
return self
|
|
249
250
|
|
|
@@ -21,8 +21,8 @@ class HtmlEscapeUtils:
|
|
|
21
21
|
|
|
22
22
|
# Regex patterns to escape only non-escaped characters
|
|
23
23
|
# Using negative lookbehind to avoid double escaping
|
|
24
|
-
_LESS_THAN_PATTERN = re.compile(
|
|
25
|
-
_GREATER_THAN_PATTERN = re.compile(
|
|
24
|
+
_LESS_THAN_PATTERN = re.compile('<')
|
|
25
|
+
_GREATER_THAN_PATTERN = re.compile('>')
|
|
26
26
|
|
|
27
27
|
@staticmethod
|
|
28
28
|
def escape_html_tags(text: Optional[str]) -> Optional[str]:
|
|
@@ -52,8 +52,8 @@ class HtmlEscapeUtils:
|
|
|
52
52
|
return text # No HTML tags found, return original string
|
|
53
53
|
|
|
54
54
|
# Use regex with negative lookbehind to escape only non-escaped characters
|
|
55
|
-
result = HtmlEscapeUtils._LESS_THAN_PATTERN.sub(
|
|
56
|
-
result = HtmlEscapeUtils._GREATER_THAN_PATTERN.sub(
|
|
55
|
+
result = HtmlEscapeUtils._LESS_THAN_PATTERN.sub('<', text)
|
|
56
|
+
result = HtmlEscapeUtils._GREATER_THAN_PATTERN.sub('>', result)
|
|
57
57
|
|
|
58
58
|
return result
|
|
59
59
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: testit-python-commons
|
|
3
|
-
Version: 3.10.
|
|
3
|
+
Version: 3.10.5
|
|
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
|
|
21
21
|
Dynamic: author
|
|
22
22
|
Dynamic: author-email
|
|
23
23
|
Dynamic: classifier
|
|
@@ -16,7 +16,7 @@ class TestHtmlEscapeUtils(unittest.TestCase):
|
|
|
16
16
|
"""Test basic HTML tag escaping"""
|
|
17
17
|
text = "Hello <script>alert('test')</script> world"
|
|
18
18
|
result = HtmlEscapeUtils.escape_html_tags(text)
|
|
19
|
-
expected = "Hello
|
|
19
|
+
expected = "Hello <script>alert('test')</script> world"
|
|
20
20
|
self.assertEqual(result, expected)
|
|
21
21
|
|
|
22
22
|
def test_escape_html_tags_no_html_content(self):
|
|
@@ -38,18 +38,18 @@ class TestHtmlEscapeUtils(unittest.TestCase):
|
|
|
38
38
|
|
|
39
39
|
def test_escape_html_tags_no_double_escaping(self):
|
|
40
40
|
"""Test that already escaped characters are not double-escaped"""
|
|
41
|
-
text = "Already
|
|
41
|
+
text = "Already <escaped> and <not_escaped>"
|
|
42
42
|
result = HtmlEscapeUtils.escape_html_tags(text)
|
|
43
|
-
expected = "Already
|
|
43
|
+
expected = "Already <escaped> and <not_escaped>"
|
|
44
44
|
self.assertEqual(result, expected)
|
|
45
45
|
|
|
46
46
|
def test_escape_html_tags_various_tags(self):
|
|
47
47
|
"""Test escaping of various HTML tag types"""
|
|
48
48
|
test_cases = [
|
|
49
|
-
("<div>content</div>", "
|
|
50
|
-
("<img src='test.jpg'/>", "
|
|
51
|
-
("<br>", "
|
|
52
|
-
("<span class='test'>text</span>", "
|
|
49
|
+
("<div>content</div>", "<div>content</div>"),
|
|
50
|
+
("<img src='test.jpg'/>", "<img src='test.jpg'/>"),
|
|
51
|
+
("<br>", "<br>"),
|
|
52
|
+
("<span class='test'>text</span>", "<span class='test'>text</span>"),
|
|
53
53
|
("No tags here", "No tags here"), # Should remain unchanged
|
|
54
54
|
("<>", "<>"), # Empty angle brackets - should remain unchanged
|
|
55
55
|
("< >", "< >"), # Spaced angle brackets - should remain unchanged
|
|
@@ -66,8 +66,8 @@ class TestHtmlEscapeUtils(unittest.TestCase):
|
|
|
66
66
|
result = HtmlEscapeUtils.escape_html_in_object(test_obj)
|
|
67
67
|
|
|
68
68
|
self.assertEqual(result.name, "Test Name") # No escaping needed
|
|
69
|
-
self.assertEqual(result.description, "
|
|
70
|
-
self.assertEqual(result.tags[0], "
|
|
69
|
+
self.assertEqual(result.description, "<script>alert('xss')</script>") # Escaped
|
|
70
|
+
self.assertEqual(result.tags[0], "<tag>") # Escaped
|
|
71
71
|
self.assertEqual(result.tags[1], "normal_tag") # No escaping needed
|
|
72
72
|
|
|
73
73
|
def test_escape_html_in_object_list(self):
|
|
@@ -78,8 +78,8 @@ class TestHtmlEscapeUtils(unittest.TestCase):
|
|
|
78
78
|
]
|
|
79
79
|
result = HtmlEscapeUtils.escape_html_in_object_list(test_list)
|
|
80
80
|
|
|
81
|
-
self.assertEqual(result[0].description, "
|
|
82
|
-
self.assertEqual(result[1].description, "
|
|
81
|
+
self.assertEqual(result[0].description, "<div>content</div>")
|
|
82
|
+
self.assertEqual(result[1].description, "<span>more</span>")
|
|
83
83
|
|
|
84
84
|
def test_escape_disabled_by_env_var(self):
|
|
85
85
|
"""Test that escaping can be disabled via environment variable"""
|
|
@@ -107,8 +107,8 @@ class TestHtmlEscapeUtils(unittest.TestCase):
|
|
|
107
107
|
result = HtmlEscapeUtils.escape_html_in_object(test_dict)
|
|
108
108
|
|
|
109
109
|
self.assertEqual(result["name"], "Test")
|
|
110
|
-
self.assertEqual(result["description"], "
|
|
111
|
-
self.assertEqual(result["tags"][0], "
|
|
110
|
+
self.assertEqual(result["description"], "<script>alert('xss')</script>")
|
|
111
|
+
self.assertEqual(result["tags"][0], "<tag>")
|
|
112
112
|
self.assertEqual(result["tags"][1], "normal_tag")
|
|
113
113
|
|
|
114
114
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/tests/test_app_properties.py
RENAMED
|
File without changes
|
{testit_python_commons-3.10.4.post550 → testit_python_commons-3.10.5}/tests/test_dynamic_methods.py
RENAMED
|
File without changes
|