OXIESEC PANEL
- Current Dir:
/
/
snap
/
certbot
/
4730
/
lib
/
python3.12
/
site-packages
/
setuptools
/
_distutils
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
__init__.py
1.45 KB
06/10/2025 09:50:49 PM
rw-r--r--
📁
__pycache__
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📁
compat
-
06/10/2025 09:51:14 PM
rwxr-xr-x
📄
support.py
4 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_archive_util.py
11.51 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_bdist.py
1.36 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_bdist_dumb.py
2.19 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_bdist_rpm.py
3.84 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_build.py
1.7 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_build_clib.py
4.23 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_build_ext.py
22.02 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_build_py.py
6.72 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_build_scripts.py
2.81 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_check.py
6.08 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_clean.py
1.21 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_cmd.py
3.18 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_config_cmd.py
2.6 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_core.py
3.74 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_dir_util.py
4.39 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_dist.py
18.35 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_extension.py
3.58 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_file_util.py
3.44 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_filelist.py
10.51 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_install.py
8.42 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_install_data.py
2.41 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_install_headers.py
936 bytes
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_install_lib.py
3.53 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_install_scripts.py
1.56 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_log.py
323 bytes
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_modified.py
4.12 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_sdist.py
14.71 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_spawn.py
4.69 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_sysconfig.py
11.71 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_text_file.py
3.38 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_util.py
7.8 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_version.py
2.69 KB
06/10/2025 09:50:49 PM
rw-r--r--
📄
test_versionpredicate.py
0 bytes
06/10/2025 09:50:49 PM
rw-r--r--
📄
unix_compat.py
386 bytes
06/10/2025 09:50:49 PM
rw-r--r--
Editing: test_version.py
Close
"""Tests for distutils.version.""" import distutils from distutils.version import LooseVersion, StrictVersion import pytest @pytest.fixture(autouse=True) def suppress_deprecation(): with distutils.version.suppress_known_deprecation(): yield class TestVersion: def test_prerelease(self): version = StrictVersion('1.2.3a1') assert version.version == (1, 2, 3) assert version.prerelease == ('a', 1) assert str(version) == '1.2.3a1' version = StrictVersion('1.2.0') assert str(version) == '1.2' def test_cmp_strict(self): versions = ( ('1.5.1', '1.5.2b2', -1), ('161', '3.10a', ValueError), ('8.02', '8.02', 0), ('3.4j', '1996.07.12', ValueError), ('3.2.pl0', '3.1.1.6', ValueError), ('2g6', '11g', ValueError), ('0.9', '2.2', -1), ('1.2.1', '1.2', 1), ('1.1', '1.2.2', -1), ('1.2', '1.1', 1), ('1.2.1', '1.2.2', -1), ('1.2.2', '1.2', 1), ('1.2', '1.2.2', -1), ('0.4.0', '0.4', 0), ('1.13++', '5.5.kw', ValueError), ) for v1, v2, wanted in versions: try: res = StrictVersion(v1)._cmp(StrictVersion(v2)) except ValueError: if wanted is ValueError: continue else: raise AssertionError(f"cmp({v1}, {v2}) shouldn't raise ValueError") assert res == wanted, f'cmp({v1}, {v2}) should be {wanted}, got {res}' res = StrictVersion(v1)._cmp(v2) assert res == wanted, f'cmp({v1}, {v2}) should be {wanted}, got {res}' res = StrictVersion(v1)._cmp(object()) assert res is NotImplemented, ( f'cmp({v1}, {v2}) should be NotImplemented, got {res}' ) def test_cmp(self): versions = ( ('1.5.1', '1.5.2b2', -1), ('161', '3.10a', 1), ('8.02', '8.02', 0), ('3.4j', '1996.07.12', -1), ('3.2.pl0', '3.1.1.6', 1), ('2g6', '11g', -1), ('0.960923', '2.2beta29', -1), ('1.13++', '5.5.kw', -1), ) for v1, v2, wanted in versions: res = LooseVersion(v1)._cmp(LooseVersion(v2)) assert res == wanted, f'cmp({v1}, {v2}) should be {wanted}, got {res}' res = LooseVersion(v1)._cmp(v2) assert res == wanted, f'cmp({v1}, {v2}) should be {wanted}, got {res}' res = LooseVersion(v1)._cmp(object()) assert res is NotImplemented, ( f'cmp({v1}, {v2}) should be NotImplemented, got {res}' )