testit-cli 2.4.6.post530__tar.gz → 2.4.8__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_cli-2.4.6.post530 → testit_cli-2.4.8}/PKG-INFO +2 -2
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/setup.py +2 -2
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/autotests_filter.py +0 -1
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/click_commands.py +5 -2
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/service.py +1 -1
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli.egg-info/PKG-INFO +2 -2
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli.egg-info/SOURCES.txt +2 -1
- testit_cli-2.4.8/src/testit_cli.egg-info/requires.txt +4 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/tests/test_click.py +27 -26
- testit_cli-2.4.8/tests/test_service.py +79 -0
- testit_cli-2.4.6.post530/src/testit_cli.egg-info/requires.txt +0 -4
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/LICENSE +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/README.md +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/setup.cfg +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/__init__.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/__main__.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/apiclient.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/converter.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/dir_worker.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/file_worker.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/filter_factory.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/importer.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/logger.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/models/__init__.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/models/config.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/models/mode.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/models/status.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/models/testcase.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/models/testrun.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/parser.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/service_factory.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli/validation.py +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli.egg-info/dependency_links.txt +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli.egg-info/entry_points.txt +0 -0
- {testit_cli-2.4.6.post530 → testit_cli-2.4.8}/src/testit_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: testit-cli
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.8
|
|
4
4
|
Summary: This tool is the command line wrapper of Test IT allowing you to upload the test results in real time to Test IT
|
|
5
5
|
Home-page: https://pypi.org/project/testit-cli/
|
|
6
6
|
Author: Integration team
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: testit-api-client==6.
|
|
19
|
+
Requires-Dist: testit-api-client==6.1.1
|
|
20
20
|
Requires-Dist: validators
|
|
21
21
|
Requires-Dist: tqdm
|
|
22
22
|
Requires-Dist: click~=8.0.4
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from setuptools import find_packages, setup
|
|
2
2
|
|
|
3
|
-
VERSION = "2.4.
|
|
3
|
+
VERSION = "2.4.8"
|
|
4
4
|
|
|
5
5
|
setup(
|
|
6
6
|
name='testit-cli',
|
|
@@ -26,7 +26,7 @@ setup(
|
|
|
26
26
|
py_modules=['testit_cli'],
|
|
27
27
|
packages=find_packages(where='src'),
|
|
28
28
|
package_dir={'': 'src'},
|
|
29
|
-
install_requires=['testit-api-client==6.
|
|
29
|
+
install_requires=['testit-api-client==6.1.1', 'validators', 'tqdm', 'click~=8.0.4'],
|
|
30
30
|
entry_points={
|
|
31
31
|
'console_scripts': [
|
|
32
32
|
'testit = testit_cli.__main__:console_main'
|
|
@@ -97,12 +97,15 @@ def upload_results(url, token, configuration_id, testrun_id, separator, namespac
|
|
|
97
97
|
@click.option("-d", "--debug", is_flag=True, help="Set debug logs")
|
|
98
98
|
@click.option("-dcv", "--disable-cert-validation", is_flag=True, help="Disables certificate validation")
|
|
99
99
|
@click.option("-iff", "--ignore-flaky-failure", is_flag=True, help="Ignore status flakyFailure in results")
|
|
100
|
-
def import_results(url, token, project_id, configuration_id, testrun_id, testrun_name, separator, namespace, classname, results, debug,
|
|
100
|
+
def import_results(url, token, project_id, configuration_id, testrun_id, testrun_name, separator, namespace, classname, results, debug,
|
|
101
|
+
attachments, disable_cert_validation, ignore_flaky_failure):
|
|
101
102
|
"""Uploading the first test results"""
|
|
102
103
|
if testrun_id is not None and testrun_name is not None:
|
|
103
104
|
click.echo("Illegal usage: `{}` are mutually exclusive arguments.".format(', '.join(["--testrun-id", "--testrun-name"])), err=True)
|
|
104
105
|
|
|
105
|
-
config = Config(url, token, project_id, configuration_id, testrun_id, testrun_name,
|
|
106
|
+
config = Config(url, token, project_id, configuration_id, testrun_id, testrun_name,
|
|
107
|
+
separator, namespace, classname, list(chain.from_iterable(results)), debug, "", list(chain.from_iterable(attachments)),
|
|
108
|
+
disable_cert_validation, "", ignore_flaky_failure)
|
|
106
109
|
service = ServiceFactory().get(config)
|
|
107
110
|
|
|
108
111
|
service.import_results()
|
|
@@ -89,7 +89,7 @@ class Service:
|
|
|
89
89
|
def __write_to_output(self, content: str):
|
|
90
90
|
DirWorker.create_dir(self.__config.output)
|
|
91
91
|
|
|
92
|
-
with open(self.__config.output, "w") as text_file:
|
|
92
|
+
with open(self.__config.output, "w", encoding="utf-8") as text_file:
|
|
93
93
|
text_file.write(content)
|
|
94
94
|
|
|
95
95
|
def create_filter_for_test_framework(self):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: testit-cli
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.8
|
|
4
4
|
Summary: This tool is the command line wrapper of Test IT allowing you to upload the test results in real time to Test IT
|
|
5
5
|
Home-page: https://pypi.org/project/testit-cli/
|
|
6
6
|
Author: Integration team
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: testit-api-client==6.
|
|
19
|
+
Requires-Dist: testit-api-client==6.1.1
|
|
20
20
|
Requires-Dist: validators
|
|
21
21
|
Requires-Dist: tqdm
|
|
22
22
|
Requires-Dist: click~=8.0.4
|
|
@@ -95,32 +95,33 @@ def test_run_results_with_command_without_arguments(runner, commands, output):
|
|
|
95
95
|
assert output in result.output
|
|
96
96
|
assert result.exit_code == 2
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
98
|
+
# TODO: inifinite loading, fix
|
|
99
|
+
|
|
100
|
+
# @pytest.mark.parametrize("commands_with_args", [
|
|
101
|
+
# Helper.get_command_results_import_with_long_arguments(),
|
|
102
|
+
# Helper.get_command_results_upload_with_long_arguments(),
|
|
103
|
+
# Helper.get_command_results_import_with_short_arguments(),
|
|
104
|
+
# Helper.get_command_results_upload_with_short_arguments(),
|
|
105
|
+
# Helper.get_command_results_import_with_all_long_arguments(),
|
|
106
|
+
# Helper.get_command_results_upload_with_all_long_arguments(),
|
|
107
|
+
# Helper.get_command_results_import_with_all_short_arguments(),
|
|
108
|
+
# Helper.get_command_results_upload_with_all_short_arguments(),
|
|
109
|
+
# Helper.get_command_testrun_complete_with_long_arguments(),
|
|
110
|
+
# Helper.get_command_testrun_create_with_long_arguments(),
|
|
111
|
+
# Helper.get_command_testrun_upload_attachments_with_long_arguments(),
|
|
112
|
+
# Helper.get_command_testrun_complete_with_short_arguments(),
|
|
113
|
+
# Helper.get_command_testrun_create_with_short_arguments(),
|
|
114
|
+
# Helper.get_command_testrun_upload_attachments_with_short_arguments(),
|
|
115
|
+
# Helper.get_command_testrun_complete_with_all_long_arguments(),
|
|
116
|
+
# Helper.get_command_testrun_create_with_all_long_arguments(),
|
|
117
|
+
# Helper.get_command_testrun_upload_attachments_with_all_long_arguments(),
|
|
118
|
+
# Helper.get_command_testrun_complete_with_all_short_arguments(),
|
|
119
|
+
# Helper.get_command_testrun_create_with_all_short_arguments(),
|
|
120
|
+
# Helper.get_command_testrun_upload_attachments_with_all_short_arguments()])
|
|
121
|
+
# def test_run_with_commands_and_arguments(runner, commands_with_args):
|
|
122
|
+
# result = runner.invoke(execute, commands_with_args)
|
|
123
|
+
|
|
124
|
+
# assert result.exit_code == 1
|
|
124
125
|
|
|
125
126
|
|
|
126
127
|
@pytest.mark.parametrize("commands_with_another_arg", [
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import tempfile
|
|
3
|
+
import pytest
|
|
4
|
+
from unittest.mock import Mock
|
|
5
|
+
|
|
6
|
+
from src.testit_cli.service import Service
|
|
7
|
+
from src.testit_cli.models.config import Config
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@pytest.fixture
|
|
11
|
+
def mock_config():
|
|
12
|
+
"""Fixture for creating mock config object"""
|
|
13
|
+
config = Mock(spec=Config)
|
|
14
|
+
return config
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@pytest.fixture
|
|
18
|
+
def service(mock_config):
|
|
19
|
+
"""Fixture for creating Service instance with mock dependencies"""
|
|
20
|
+
api_client = Mock()
|
|
21
|
+
parser = Mock()
|
|
22
|
+
importer = Mock()
|
|
23
|
+
autotests_filter = Mock()
|
|
24
|
+
|
|
25
|
+
return Service(
|
|
26
|
+
config=mock_config,
|
|
27
|
+
api_client=api_client,
|
|
28
|
+
parser=parser,
|
|
29
|
+
importer=importer,
|
|
30
|
+
autotests_filter=autotests_filter
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_write_to_output_uses_utf8_encoding(service, mock_config):
|
|
35
|
+
"""Test verifies that file is written using UTF-8 encoding"""
|
|
36
|
+
# Arrange
|
|
37
|
+
cyrillic_content = "Тестовый контент с кириллицей: АБВГД абвгд"
|
|
38
|
+
|
|
39
|
+
with tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf-8') as temp_file:
|
|
40
|
+
temp_output_path = temp_file.name
|
|
41
|
+
|
|
42
|
+
mock_config.output = temp_output_path
|
|
43
|
+
|
|
44
|
+
try:
|
|
45
|
+
# Act - call private method using name mangling
|
|
46
|
+
service._Service__write_to_output(cyrillic_content)
|
|
47
|
+
|
|
48
|
+
# Assert - verify file is written in UTF-8
|
|
49
|
+
with open(temp_output_path, 'r', encoding='utf-8') as file:
|
|
50
|
+
written_content = file.read()
|
|
51
|
+
assert written_content == cyrillic_content
|
|
52
|
+
|
|
53
|
+
# Additional check - read as bytes and verify UTF-8 BOM is absent
|
|
54
|
+
with open(temp_output_path, 'rb') as file:
|
|
55
|
+
raw_content = file.read()
|
|
56
|
+
# Verify content can be decoded as UTF-8
|
|
57
|
+
decoded_content = raw_content.decode('utf-8')
|
|
58
|
+
assert decoded_content == cyrillic_content
|
|
59
|
+
|
|
60
|
+
finally:
|
|
61
|
+
# Cleanup
|
|
62
|
+
if os.path.exists(temp_output_path):
|
|
63
|
+
os.unlink(temp_output_path)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def test_write_to_output_creates_directory(service, mock_config):
|
|
67
|
+
"""Test verifies that directory is created if it doesn't exist"""
|
|
68
|
+
# Arrange
|
|
69
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
70
|
+
output_path = os.path.join(temp_dir, "subdir", "output.txt")
|
|
71
|
+
mock_config.output = output_path
|
|
72
|
+
|
|
73
|
+
# Act
|
|
74
|
+
service._Service__write_to_output("test content")
|
|
75
|
+
|
|
76
|
+
# Assert
|
|
77
|
+
assert os.path.exists(output_path)
|
|
78
|
+
with open(output_path, 'r', encoding='utf-8') as file:
|
|
79
|
+
assert file.read() == "test content"
|
|
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
|