HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/twisted/python/test/__pycache__/test_versions.cpython-38.pyc
U


W[�@sddZddlmZmZddlZddlmZmZddlmZddl	m
Z
ddlmZ
Gdd	�d	e
�ZdS)
z'
Tests for L{twisted.python.versions}.
�)�division�absolute_importN)�getVersionString�IncomparableVersions)�Version)�_inf)�SynchronousTestCasec@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)"�
VersionsTestscCs�tdddd�}tdddd�}|�||k�|�||k�|�||k�|�||k�|�||k�|�|tdddd�k�|�||k�dS)zB
        Versions can be compared for equality and order.
        �dummy�rN�r�
assertTrue��selfZvaZvb�r�C/usr/lib/python3/dist-packages/twisted/python/test/test_versions.py�test_versionComparisonsz$VersionsTests.test_versionComparisoncCs�tdddd�}tdddd�}|�||k�|�||k�|�||k�|�||k�|�||k�|�|tdddd�k�|�|tdddd�k�|�||k�dS)zC
        Version packages are compared case insensitively.
        Ztwistedrr�TwistedZTWIStedNrrrrr�%test_versionComparisonCaseInsensitive$sz3VersionsTests.test_versionComparisonCaseInsensitivecCsLtdddddd�}tdddd�}|�||k�|�||k�|�||�dS)zP
        Prereleases are always less than versions without prereleases.
        �whateverrr�Z
prereleaseN)rr
ZassertFalseZassertNotEqualrrrr�%test_comparingPrereleasesWithReleases4s
z3VersionsTests.test_comparingPrereleasesWithReleasesc
Cs�tdddddd�}tdddddd�}|�||k�|�||k�|�||k�|�||k�|�||k�|�|tdddddd�k�|�||k�dS)zW
        The value specified as the prerelease is used in version comparisons.
        rrrr�Nrrrrr�test_comparingPrereleases?sz'VersionsTests.test_comparingPrereleasescCs|�tt�dS)zR
        L{_inf} is equal to L{_inf}.

        This is a regression test.
        N)�assertEqualr�rrrr�test_infComparisonNsz VersionsTests.test_infComparisonc
Cs*|�ttjtdddd�tdddd��dS)zO
        The package names of the Version objects need to be the same,
        r
rrZdumymN)ZassertRaisesr�operator�eqrrrrr�test_disallowBuggyComparisonsWs
�z+VersionsTests.test_disallowBuggyComparisonscCs(tdddd�}d}|�|�|�t�dS)zh
        Comparing a L{Version} to some other object type results in
        C{NotImplemented}.
        r
rr)r
rrrN)rrZ__cmp__�NotImplementedrrrr�test_notImplementedComparisonsasz,VersionsTests.test_notImplementedComparisonscCs|�ttdddd��d�dS)zu
        Calling C{repr} on a version returns a human-readable string
        representation of the version.
        r
rr�zVersion('dummy', 1, 2, 3)N�r�reprrrrrr�	test_reprks�zVersionsTests.test_reprc
Cs"|�ttdddddd��d�dS)	z�
        Calling C{repr} on a version with a prerelease returns a human-readable
        string representation of the version including the prerelease.
        r
rrr"�rz.Version('dummy', 1, 2, 3, release_candidate=4)Nr#rrrr�test_reprWithPrereleasets�z%VersionsTests.test_reprWithPrereleasecCs|�ttdddd��d�dS)zt
        Calling C{str} on a version returns a human-readable string
        representation of the version.
        r
rrr"z[dummy, version 1.2.3]N�r�strrrrrr�test_str}s�zVersionsTests.test_strc
Cs"|�ttdddddd��d�dS)zX
        Calling C{str} on a version with a prerelease includes the prerelease.
        r
rrrz[dummy, version 1.0.0rc1]Nr(rrrr�test_strWithPrerelease�s�z$VersionsTests.test_strWithPrereleasecCs|�tdddd���d�dS)Nr
rrr"z1.2.3)rrZshortrrrr�	testShort�szVersionsTests.testShortc	Cs|�dttdddd���dS)zr
        L{getVersionString} returns a string with the package name and the
        short version number.
        z
Twisted 8.0.0r�rN�rrrrrrr�test_getVersionString�s�z#VersionsTests.test_getVersionStringc
Cs"|�ttdddddd��d�dS)zF
        L{getVersionString} includes the prerelease, if any.
        rr-rrrzwhatever 8.0.0rc1Nr.rrrr�#test_getVersionStringWithPrerelease�s�z1VersionsTests.test_getVersionStringWithPrereleasecCs|�tdddd���d�dS)zY
        The L{base} method returns a very simple representation of the version.
        �foorrz1.0.0N�rr�baserrrr�	test_base�szVersionsTests.test_basec	Cs"|�tdddddd���d�dS)zQ
        The base version includes 'preX' for versions with prereleases.
        r1rrr-rz1.0.0rc8Nr2rrrr�test_baseWithPrerelease�s�z%VersionsTests.test_baseWithPrereleaseN)�__name__�
__module__�__qualname__rrrrrrr!r%r'r*r+r,r/r0r4r5rrrrr	s 	

					r	)�__doc__Z
__future__rrrZtwisted.python.versionsrrrZincrementalrZtwisted.trial.unittestrZTestCaser	rrrr�<module>s