PATH: //proc/thread-self/root/opt/alt/python311/lib64/python3.11/distutils/tests
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 Setup.sample
↓
X
📄 __init__.py
↓
X
📁 __pycache__/
X
📄 includetest.rst
↓
X
📄 support.py
↓
X
📄 test_archive_util.py
↓
X
📄 test_bdist.py
↓
X
📄 test_bdist_dumb.py
↓
X
📄 test_bdist_rpm.py
↓
X
📄 test_build.py
↓
X
📄 test_build_clib.py
↓
X
📄 test_build_ext.py
↓
X
📄 test_build_py.py
↓
X
📄 test_build_scripts.py
↓
X
📄 test_check.py
↓
X
📄 test_clean.py
↓
X
📄 test_cmd.py
↓
X
📄 test_config.py
↓
X
📄 test_config_cmd.py
↓
X
📄 test_core.py
↓
X
📄 test_cygwinccompiler.py
↓
X
📄 test_dep_util.py
↓
X
📄 test_dir_util.py
↓
X
📄 test_dist.py
↓
X
📄 test_extension.py
↓
X
📄 test_file_util.py
↓
X
📄 test_filelist.py
↓
X
📄 test_install.py
↓
X
📄 test_install_data.py
↓
X
📄 test_install_headers.py
↓
X
📄 test_install_lib.py
↓
X
📄 test_install_scripts.py
↓
X
📄 test_log.py
↓
X
📄 test_msvc9compiler.py
↓
X
📄 test_msvccompiler.py
↓
X
📄 test_register.py
↓
X
📄 test_sdist.py
↓
X
📄 test_spawn.py
↓
X
📄 test_sysconfig.py
↓
X
📄 test_text_file.py
↓
X
📄 test_unixccompiler.py
↓
X
📄 test_upload.py
↓
X
📄 test_util.py
↓
X
📄 test_version.py
↓
X
📄 test_versionpredicate.py
↓
X
📄 xxmodule.c
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: test_version.py
"""Tests for distutils.version.""" import unittest from distutils.version import LooseVersion from distutils.version import StrictVersion class VersionTestCase(unittest.TestCase): def test_prerelease(self): version = StrictVersion('1.2.3a1') self.assertEqual(version.version, (1, 2, 3)) self.assertEqual(version.prerelease, ('a', 1)) self.assertEqual(str(version), '1.2.3a1') version = StrictVersion('1.2.0') self.assertEqual(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(("cmp(%s, %s) " "shouldn't raise ValueError") % (v1, v2)) self.assertEqual(res, wanted, 'cmp(%s, %s) should be %s, got %s' % (v1, v2, wanted, res)) res = StrictVersion(v1)._cmp(v2) self.assertEqual(res, wanted, 'cmp(%s, %s) should be %s, got %s' % (v1, v2, wanted, res)) res = StrictVersion(v1)._cmp(object()) self.assertIs(res, NotImplemented, 'cmp(%s, %s) should be NotImplemented, got %s' % (v1, v2, 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)) self.assertEqual(res, wanted, 'cmp(%s, %s) should be %s, got %s' % (v1, v2, wanted, res)) res = LooseVersion(v1)._cmp(v2) self.assertEqual(res, wanted, 'cmp(%s, %s) should be %s, got %s' % (v1, v2, wanted, res)) res = LooseVersion(v1)._cmp(object()) self.assertIs(res, NotImplemented, 'cmp(%s, %s) should be NotImplemented, got %s' % (v1, v2, res)) if __name__ == "__main__": unittest.main()
SIMPAN PERUBAHAN