+
    HwihI                     |    R t ^ RIHtHt ^ RIt^ RIt^ RIt^ RIt^ RIHtH	t	 ^ RIH
t
Ht ^ RIHt  ! R R]4      tR# )z
Tests for L{incremental}.
)divisionabsolute_importN)getVersionStringIncomparableVersions)Version_inf)TestCasec                     a  ] tR t^t o R tR t]P                  ! ]P                  R98  R4      R 4       t
R tR tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R t$R t%R  t&R! t'R" t(R# t)R$ t*R% t+R& t,R' t-R( t.R) t/R* t0R+ t1R, t2R- t3R. t4R/ t5R0 t6R1 t7R2 t8R3 t9R4 t:R5 t;R6 t<R7t=V t>R8# ):VersionsTestsc           
         \        R^^ ^ ^^^R7      pV P                  VP                  4       VP                  4       4       R# )z5
The local version is the same as the short version.
dummyrelease_candidatepostdevN)r   assertEquallocalshort)selfvas   & @/usr/lib/python3/dist-packages/incremental/tests/test_version.pytest_localIsShortVersionsTests.test_localIsShort   s6     WaAJRXXZ0    c           	     b   \        R^^ ^ 4      p\        R^ ^^ 4      pV P                  W8  4       V P                  W!8  4       V P                  W8  4       V P                  W!8*  4       V P                  W8g  4       V P                  V\        R^ ^^ 4      8H  4       V P                  W"8H  4       R# )z2
Versions can be compared for equality and order.
r   Nr   
assertTruer   r   vbs   &  r   test_versionComparison$VersionsTests.test_versionComparison        WaA&WaA&  !!!ggq!Q778!r   zComparisons do not raise on py2c                j   \        R^^ ^ 4      p\        4       pV P                  \        4      ;_uu_ 4        W8   RRR4       V P                  \        4      ;_uu_ 4        W8   RRR4       V P                  \        4      ;_uu_ 4        W8   RRR4       V P                  \        4      ;_uu_ 4        W8*   RRR4       V P	                  W8H  4       V P                  W8g  4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lq; i)z-
Versions can be compared with non-versions.
r   N)r   objectassertRaises	TypeErrorassertFalser   )r   vos   &  r    test_versionComparisonNonVersion.VersionsTests.test_versionComparisonNonVersion+   s    
 GQ1%Hy))E * y))E * y))F * y))F * 	  *) *) *) *)s/   C) C<
D4D")C9	<D	D	"D2	c           	     b   \        R^^ ^ 4      p\        R^ ^^ 4      pV P                  W8  4       V P                  W!8  4       V P                  W8  4       V P                  W!8*  4       V P                  W8g  4       V P                  V\        R^ ^^ 4      8H  4       V P                  W"8H  4       R# )z-
Version package names are case insensitive.
r   DuMmYNr   r   s   &  r   %test_versionComparisonCaseInsensitive3VersionsTests.test_versionComparisonCaseInsensitiveB   r!   r   c                    \        RR^ ^ 4      p\        R^^ ^ 4      pV P                  W8  4       V P                  W8  4       V P                  W!4       R# )z9
NEXT releases are always larger than numbered releases.
whateverNEXTNr   r   r&   assertNotEqualsr   s   &  r   test_comparingNEXTReleases(VersionsTests.test_comparingNEXTReleasesP   sP     ZA.ZAq) !R$r   c                   V P                  \        4      ;_uu_ 4        \        RR^^ ^ ^ ^ R7       RRR4       V P                  \        4      ;_uu_ 4        \        RR^ ^^ ^ ^ R7       RRR4       V P                  \        4      ;_uu_ 4        \        RR^ ^ ^^ ^ R7       RRR4       V P                  \        4      ;_uu_ 4        \        RR^ ^ ^ ^^ R7       RRR4       V P                  \        4      ;_uu_ 4        \        RR^ ^ ^ ^ ^R7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)zB
NEXT releases must always have the rest of the numbers set to 0.
r0   r1   r   Nr$   
ValueErrorr   r   s   &r   test_NEXTMustBeAlone"VersionsTests.test_NEXTMustBeAloneZ   s    z**J1qQ + z**J1qQ + z**J1qQ + z**J1qQ + z**J1qQ +* +* +* +* +* +**s;   DD.EE>E'D+	.D>	E	E$	'E8	c                `    \        RR^ ^ 4      p\        RR^ ^ 4      pV P                  W!4       R# )z(
NEXT releases are equal to each other.
r0   r1   N)r   assertEqualsr   s   &  r   test_comparingNEXTReleasesEqual-VersionsTests.test_comparingNEXTReleasesEqualm   s2     ZA.ZA."!r   c                    \        R^^ ^ ^R7      p\        R^^ ^ 4      pV P                  W8  4       V P                  W8  4       V P                  W!4       R# )z@
Prereleases are always less than versions without prereleases.
r0   
prereleaseNr2   r   s   &  r   %test_comparingPrereleasesWithReleases3VersionsTests.test_comparingPrereleasesWithReleasesu   sR     ZAqQ7ZAq) !R$r   c                    \        R^^ ^ ^R7       V P                  4       pV P                  \        V4      ^4       V P                  V^ ,          R,          R4       R# )z0
Passing 'prerelease' to Version is deprecated.
r0   rA   messagezvPassing prerelease to incremental.Version was deprecated in Incremental 16.9.0. Please pass release_candidate instead.N)r   flushWarningsr   len)r   warningss   & r   test_prereleaseDeprecated'VersionsTests.test_prereleaseDeprecated   sV     	
Aq!2%%'X*QK	"I	
r   c                    \        R^^ ^ ^R7      pVP                   V P                  4       pV P                  \	        V4      ^4       V P                  V^ ,          R,          R4       R# )z4
Accessing 'prerelease' on a Version is deprecated.
r0   r   rF   zuAccessing incremental.Version.prerelease was deprecated in Incremental 16.9.0. Use Version.release_candidate instead.N)r   rB   rG   r   rH   )r   r   rI   s   &  r   "test_prereleaseAttributeDeprecated0VersionsTests.test_prereleaseAttributeDeprecated   s_     ZAqA>
%%'X*QK	"I	
r   c                    \        R^^ ^ ^R7      p\        R^^ ^ 4      pV P                  W8  4       V P                  W8  4       V P                  W!4       R# )zN
Release Candidates are always less than versions without release
candidates.
r0   rM   Nr2   r   s   &  r   +test_comparingReleaseCandidatesWithReleases9VersionsTests.test_comparingReleaseCandidatesWithReleases   sR    
 ZAqA>ZAq) !R$r   c                    \        R^^ ^ ^R7      p\        R^^ ^ 4      pV P                  W8  4       V P                  W8  4       V P                  W!4       R# )zG
Post releases are always greater than versions without post
releases.
r0   r   Nr2   r   s   &  r   &test_comparingPostReleasesWithReleases4VersionsTests.test_comparingPostReleasesWithReleases   sR    
 ZAqq1ZAq) !R$r   c                    \        R^^ ^^R7      p\        R^^ ^ ^R7      pV P                  W8  4       V P                  W8  4       V P                  W!4       R# )zO
Dev releases are always greater than postreleases based on previous
releases.
r0   r   rT   Nr2   r   s   &  r   1test_comparingDevReleasesWithPreviousPostReleases?VersionsTests.test_comparingDevReleasesWithPreviousPostReleases   sT    
 ZAqa0ZAqq1 !R$r   c                    \        R^^ ^ ^R7      p\        R^^ ^ 4      pV P                  W8  4       V P                  W8  4       V P                  W!4       R# )zB
Dev releases are always less than versions without dev releases.
r0   rX   Nr2   r   s   &  r   %test_comparingDevReleasesWithReleases3VersionsTests.test_comparingDevReleasesWithReleases   sR     ZAqa0ZAq) !R$r   c                    \        R^^ ^ ^R7      p\        R^^ ^ ^R7      pV P                  W8H  4       V P                  W8g  4       R# )z.
Release Candidates are equal to prereleases.
r0   rM   rA   N)r   r   r&   r   s   &  r   test_rcEqualspreVersionsTests.test_rcEqualspre   sF     ZAqA>ZAqQ7!"r   c                    V P                  \        4      ;_uu_ 4        \        R^^ ^ ^^R7       RRR4       R#   + '       g   i     R# ; i)z7
Release Candidate and prerelease can't both be given.
r0   )rB   r   Nr7   r9   s   &r   test_rcOrpreButNotBoth$VersionsTests.test_rcOrpreButNotBoth   s6     z**J1aAK +***s	   :A	c                n   \        R^^ ^ ^R7      p\        R^^ ^ ^R7      pV P                  W8  4       V P                  W!8  4       V P                  W8*  4       V P                  W!8  4       V P                  W8g  4       V P                  V\        R^^ ^ ^R7      8H  4       V P                  W8H  4       R# )zN
The value specified as the release candidate is used in version
comparisons.
r0   rM   Nr   r   s   &  r   test_comparingReleaseCandidates-VersionsTests.test_comparingReleaseCandidates   s    
 ZAqA>ZAqA>  !!!gj!QQOOP!r   c                n   \        R^^ ^ ^R7      p\        R^^ ^ ^R7      pV P                  W8  4       V P                  W!8  4       V P                  W8*  4       V P                  W!8  4       V P                  W8g  4       V P                  V\        R^^ ^ ^R7      8H  4       V P                  W8H  4       R# )zH
The value specified as the postrelease is used in version comparisons.
r0   rT   Nr   r   s   &  r   test_comparingPost VersionsTests.test_comparingPost   s     ZAqq1ZAqq1  !!!gj!QBBC!r   c                n   \        R^^ ^ ^R7      p\        R^^ ^ ^R7      pV P                  W8  4       V P                  W!8  4       V P                  W8*  4       V P                  W!8  4       V P                  W8g  4       V P                  V\        R^^ ^ ^R7      8H  4       V P                  W8H  4       R# )zH
The value specified as the dev release is used in version comparisons.
r0   rX   Nr   r   s   &  r   test_comparingDevVersionsTests.test_comparingDev   s     ZAqa0ZAqa0  !!!gj!QqAAB!r   c                t   \        R^^ ^ ^^R7      p\        R^^ ^ ^^R7      pV P                  W8  4       V P                  W!8  4       V P                  W8*  4       V P                  W!8  4       V P                  W8g  4       V P                  V\        R^^ ^ ^^R7      8H  4       V P                  W8H  4       R# z^
The value specified as the dev release and release candidate is used in
version comparisons.
r0   r   r   Nr   r   s   &  r   test_comparingDevAndRC$VersionsTests.test_comparingDevAndRC       
 ZAqA1EZAqA1E  !!!gj!QQTUVVW!r   c                t   \        R^^ ^ ^^R7      p\        R^^ ^ ^^R7      pV P                  W8  4       V P                  W!8  4       V P                  W8*  4       V P                  W!8  4       V P                  W8g  4       V P                  V\        R^^ ^ ^^R7      8H  4       V P                  W8H  4       R# rn   r   r   s   &  r   test_comparingDevAndRCDifferent-VersionsTests.test_comparingDevAndRCDifferent  rr   r   c                R   V P                  \        \        4       V P                  \        \        8  4       V P                  \        \        8  4       V P                  \        \        8  4       V P                  \        \        8*  4       V P                  \        \        8g  4       R# )z:
L{_inf} is equal to L{_inf}.

This is a regression test.
N)r   r   r&   r   r9   s   &r   test_infComparisonSelf$VersionsTests.test_infComparisonSelf  sj     	t$%%%%&r   c                :   \        4       pV P                  \        V8  4       V P                  \        V8  4       V P                  \        V8  4       V P                  \        V8*  4       V P                  \        V8g  4       V P                  \        V8H  4       R# )z+
L{_inf} is greater than any other object.
N)r#   r   r   r&   )r   r(   s   & r   test_infComparison VersionsTests.test_infComparison+  sq     Hq!"	"#	"#r   c                    V P                  \        \        P                  \	        R^^ ^ 4      \	        R^^ ^ 4      4       R# )z?
The package names of the Version objects need to be the same.
r   dumymN)r$   r   operatoreqr   r9   s   &r   test_disallowBuggyComparisons+VersionsTests.test_disallowBuggyComparisons7  s8     	 KKGQ1%GQ1%		
r   c                p    \        R^^ ^ 4      pRpV P                  VP                  V4      \        4       R# )zP
Comparing a L{Version} to some other object type results in
C{NotImplemented}.
r   N)r          r   )r   r   __cmp__NotImplementedr   s   &  r   test_notImplementedComparisons,VersionsTests.test_notImplementedComparisonsB  s1    
 WaA&B8r   c           
     T    V P                  \        \        R^^^4      4      R4       R# )z]
Calling C{repr} on a version returns a human-readable string
representation of the version.
r   zVersion('dummy', 1, 2, 3)Nr   reprr   r9   s   &r   	test_reprVersionsTests.test_reprK  s%    
 	ggq!Q78:UVr   c                X    V P                  \        \        R^^^^R7      4      R4       R# )z
Calling C{repr} on a version with a prerelease returns a human-readable
string representation of the version including the prerelease as a
release candidate..
r   rA   .Version('dummy', 1, 2, 3, release_candidate=4)Nr   r9   s   &r   test_reprWithPrerelease%VersionsTests.test_reprWithPrereleaseR  s*     	!Qa89<	
r   c                X    V P                  \        \        R^^^^R7      4      R4       R# )z
Calling C{repr} on a version with a release candidate returns a
human-readable string representation of the version including the rc.
r   rM   r   Nr   r9   s   &r   test_reprWithReleaseCandidate+VersionsTests.test_reprWithReleaseCandidate]  s*    
 	!QQ?@<	
r   c                X    V P                  \        \        R^^^^R7      4      R4       R# )z
Calling C{repr} on a version with a postrelease returns a
human-readable string representation of the version including the
postrelease.
r   rT   z!Version('dummy', 1, 2, 3, post=4)Nr   r9   s   &r   test_reprWithPostVersionsTests.test_reprWithPostg  s*     	!Q235X	
r   c                X    V P                  \        \        R^^^^R7      4      R4       R# )z
Calling C{repr} on a version with a dev release returns a
human-readable string representation of the version including the dev
release.
r   rX   z Version('dummy', 1, 2, 3, dev=4)Nr   r9   s   &r   test_reprWithDevVersionsTests.test_reprWithDevq  s*     	!Qq124V	
r   c           
     T    V P                  \        \        R^^^4      4      R4       R# )z\
Calling C{str} on a version returns a human-readable string
representation of the version.
r   z[dummy, version 1.2.3]Nr   strr   r9   s   &r   test_strVersionsTests.test_str{  s%    
 	WWaA679QRr   c                X    V P                  \        \        R^^ ^ ^R7      4      R4       R# )z_
Calling C{str} on a version with a prerelease includes the prerelease
as a release candidate.
r   rA   [dummy, version 1.0.0rc1]Nr   r9   s   &r   test_strWithPrerelease$VersionsTests.test_strWithPrerelease  s*    
 	AqQ78:U	
r   c                X    V P                  \        \        R^^ ^ ^R7      4      R4       R# )zV
Calling C{str} on a version with a release candidate includes the
release candidate.
r   rM   r   Nr   r9   s   &r   test_strWithReleaseCandidate*VersionsTests.test_strWithReleaseCandidate  s*    
 	AqA>?'	
r   c                X    V P                  \        \        R^^ ^ ^R7      4      R4       R# )zJ
Calling C{str} on a version with a postrelease includes the
postrelease.
r   rT   z[dummy, version 1.0.0.post1]Nr   r9   s   &r   test_strWithPostVersionsTests.test_strWithPost  s*    
 	Aqq124R	
r   c                Z    V P                  \        \        R^^ ^ ^^R7      4      R4       R# )zz
Calling C{str} on a version with a release candidate and dev release
includes the release candidate and the dev release.
r   ro   z[dummy, version 1.0.0rc1.dev2]Nr   r9   s   &r   "test_strWithDevAndReleaseCandidate0VersionsTests.test_strWithDevAndReleaseCandidate  s,    
 	AqA1EF,	
r   c                X    V P                  \        \        R^^ ^ ^R7      4      R4       R# )zJ
Calling C{str} on a version with a dev release includes the dev
release.
r   rX   z[dummy, version 1.0.0.dev1]Nr   r9   s   &r   test_strWithDevVersionsTests.test_strWithDev  s*    
 	Aqa013P	
r   c                Z    V P                  \        \        R^^ ^ ^^R7      4      R4       R# )zn
Calling C{str} on a version with a postrelease and dev release
includes the postrelease and the dev release.
r   r   r   z![dummy, version 1.0.0.post1.dev2]Nr   r9   s   &r   test_strWithDevAndPost$VersionsTests.test_strWithDevAndPost  s,    
 	Aqqa89/	
r   c                ^    V P                  \        R ^^^4      P                  4       R4       R# )r   z1.2.3N)r   r   r   r9   s   &r   	testShortVersionsTests.testShort  s&    !Q288:GDr   c                T    V P                  R\        \        R^^ ^ 4      4      4       R# )zZ
L{getVersionString} returns a string with the package name and the
short version number.
zTwisted 8.0.0TwistedNr   r   r   r9   s   &r   test_getVersionString#VersionsTests.test_getVersionString  s'    
 	*:79aQRTU;V*WXr   c                X    V P                  \        \        R^^ ^ ^R7      4      R4       R# )zM
L{getVersionString} includes the prerelease as a release candidate, if
any.
r0   rA   whatever 8.0.0rc1Nr   r9   s   &r   #test_getVersionStringWithPrerelease1VersionsTests.test_getVersionStringWithPrerelease  s*    
 	WZAqQGH	
r   c                X    V P                  \        \        R^^ ^ ^R7      4      R4       R# )z=
L{getVersionString} includes the release candidate, if any.
r0   rM   r   Nr   r9   s   &r   )test_getVersionStringWithReleaseCandidate7VersionsTests.test_getVersionStringWithReleaseCandidate  s*     	WZAqANO	
r   c                X    V P                  \        \        R^^ ^ ^R7      4      R4       R# )z7
L{getVersionString} includes the postrelease, if any.
r0   rT   zwhatever 8.0.0.post1Nr   r9   s   &r   test_getVersionStringWithPost+VersionsTests.test_getVersionStringWithPost  s*     	WZAqqAB"	
r   c                X    V P                  \        \        R^^ ^ ^R7      4      R4       R# )z7
L{getVersionString} includes the dev release, if any.
r0   rX   zwhatever 8.0.0.dev1Nr   r9   s   &r   test_getVersionStringWithDev*VersionsTests.test_getVersionStringWithDev  s*     	WZAqa@ACX	
r   c                Z    V P                  \        \        R^^ ^ ^^R7      4      R4       R# )zM
L{getVersionString} includes the dev release and release candidate, if
any.
r0   ro   zwhatever 8.0.0rc2.dev1Nr   r9   s   &r   !test_getVersionStringWithDevAndRC/VersionsTests.test_getVersionStringWithDevAndRC  s-    
 	WZAqASTUV$	
r   c                Z    V P                  \        \        R^^ ^ ^^R7      4      R4       R# )zG
L{getVersionString} includes the dev release and postrelease, if
any.
r0   r   zwhatever 8.0.0.post2.dev1Nr   r9   s   &r   #test_getVersionStringWithDevAndPost1VersionsTests.test_getVersionStringWithDevAndPost  s,    
 	WZAqqaHI'	
r   c                ^    V P                  \        RR^ ^ 4      P                  4       R4       R# )zH
The C{base} method returns just "NEXT" when NEXT is the major version.
foor1   Nr   r   baser9   s   &r   test_baseWithNEXTVersionsTests.test_baseWithNEXT  s(     	15::<fEr   c                ^    V P                  \        R^^ ^ 4      P                  4       R4       R# )zI
The C{base} method returns a very simple representation of the version.
r   z1.0.0Nr   r9   s   &r   	test_baseVersionsTests.test_base  s(     	1a0557Ar   c           
     b    V P                  \        R^^ ^ ^R7      P                  4       R4       R# )@
The base version includes 'rcX' for versions with prereleases.
r   rA   1.0.0rc8Nr   r9   s   &r   test_baseWithPrerelease%VersionsTests.test_baseWithPrerelease	  s*     	1aA>CCEzRr   c           
     b    V P                  \        R^^ ^ ^R7      P                  4       R4       R# )zC
The base version includes 'postX' for versions with postreleases.
r   rT   z1.0.0.post8Nr   r9   s   &r   test_baseWithPostVersionsTests.test_baseWithPost  s*     	1aa8==?Or   c           
     b    V P                  \        R^^ ^ ^R7      P                  4       R4       R# )zB
The base version includes 'devX' for versions with dev releases.
r   rX   z
1.0.0.dev8Nr   r9   s   &r   test_baseWithDevVersionsTests.test_baseWithDev  s*     	1aQ7<<>Mr   c           
     b    V P                  \        R^^ ^ ^R7      P                  4       R4       R# )r   r   rM   r   Nr   r9   s   &r   test_baseWithReleaseCandidate+VersionsTests.test_baseWithReleaseCandidate  s-     	E1aa8==?	
r   c                d    V P                  \        R^^ ^ ^^R7      P                  4       R4       R# )z]
The base version includes 'rcXdevX' for versions with dev releases and
a release candidate.
r   ro   z1.0.0rc2.dev8Nr   r9   s   &r   test_baseWithDevAndRC#VersionsTests.test_baseWithDevAndRC#  s/    
 	E1aaQ?DDF	
r   c                d    V P                  \        R^^ ^ ^^R7      P                  4       R4       R# )zY
The base version includes 'postXdevX' for versions with dev releases
and a postrelease.
r   r   z1.0.0.post2.dev8Nr   r9   s   &r   test_baseWithDevAndPost%VersionsTests.test_baseWithDevAndPost,  s0    
 	E1a2779;M	
r    N)   )?__name__
__module____qualname____firstlineno__r   r   unittestskipIfsysversion_infor)   r-   r4   r:   r>   rC   rJ   rN   rQ   rU   rY   r\   r_   rb   re   rh   rk   rp   rt   rw   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r   r
   r
      sE    1" __S%%,.OP  Q ,"%R&"%

	%	%	%%#L"""""'
$	
9W	



S





EY





FBSPN


 
r   r
   )__doc__
__future__r   r   r   r   r~   incrementalr   r   r   r   twisted.trial.unittestr   r
   r   r   r   <module>r      s2    1 
    > % +^
H ^
r   