+
    Hwi  ã                   ód   € R t ^ RIt^ RIHtHtHt ^ RIHt ^ RIH	t	 ^ RI
HtHt  ! R R]	4      tR# )z1Test handling of ``pyproject.toml`` configurationN)ÚcastÚOptionalÚUnion)ÚPath)ÚTestCase)Ú_load_pyproject_tomlÚ_IncrementalConfigc                   ót   a € ] tR t^t o RtRR/V 3R lR lltR tR tR tR	 t	R
 t
R tR tR tR tRtV tR# )ÚVerifyPyprojectDotTomlTestsz/Test the `_load_pyproject_toml` helper functionÚpathNc                óT   <€ V ^8„  d   QhRS[ RS[S[S[ R3,          RS[S[,          /# )é   Útomlr   NÚreturn)Ústrr   r   r   r   )ÚformatÚ__classdict__s   "€ÚB/usr/lib/python3/dist-packages/incremental/tests/test_pyproject.pyÚ__annotate__Ú(VerifyPyprojectDotTomlTests.__annotate__   s6   ø€ ÷ ñ ÙðÙ"'©©c°4¨Õ"8ðá	Ñ$Õ	%ñó    c               óP  € Vf   V P                  4       pM\        V4      p\        VR4      ;_uu_ 4       pVP                  V4       RRR4        \	        V4      #   + '       g   i     L; i  \
         d-   p\        TR4      '       d   TP                  RT 24       h Rp?ii ; i)z¨
Read a TOML snipped from a temporary file with `_load_pyproject_toml`

@param toml: TOML content of the temporary file

@param path: Path to which the TOML is written
NÚwÚadd_notezWhile loading:

)Úmktempr   ÚopenÚwriter   Ú	ExceptionÚhasattrr   )Úselfr   r   Úpath_ÚfÚes   &&$   r   Ú	_loadTomlÚ%VerifyPyprojectDotTomlTests._loadToml   sŽ   € ð Š<Ø—K‘K“M‰Eä˜“IˆEä�%˜×Ô Ø�G‰G�DŒM÷ ð	Ü'¨Ó.Ð.÷	 ×ûô
 ô 	Ü�q˜*×%Ò%Ø—
‘
Ø(¨¨Ð/ôð ûð	ús#   µAÁ
A. ÁA+	Á.B%Á9'B Â B%c                ó´   € \         P                  P                  \        \        V P                  4       4      R4      pV P                  \        \        V4       R# )zN
An absent ``pyproject.toml`` file produces no result unless
there is opt-in.
úpyproject.tomlN)	Úosr   Újoinr   r   r   ÚassertRaisesÚFileNotFoundErrorr   )r   r   s   & r   Útest_fileNotFoundÚ-VerifyPyprojectDotTomlTests.test_fileNotFound-   s:   € ô
 �w‰w�|‰|œD¤ d§k¡k£mÓ4Ð6FÓGˆØ×ÑÔ+Ô-AÀ4ÖHr   c                óL   € RpV P                  \        V P                  V4       R# )zp
Syntactially invalid TOML produces an exception. The specific
exception varies by the underlying TOML library.
z[project]
name = "abcN)r)   r   r#   ©r   r   s   & r   Útest_brokenTomlÚ+VerifyPyprojectDotTomlTests.test_brokenToml5   s   € ð
 (ˆØ×Ñœ) T§^¡^°TÖ:r   c                óZ   € R F$  pV P                  \        V P                  V4       K&  	  R# )z@
`ValueError` is raised when we can't extract the project name.
N)Ú
z[tool.notincremental]
z
[project]
z[tool.incremental]
z[project]
[tool.incremental]
©r)   Ú
ValueErrorr#   r.   s   & r   Útest_nameMissingÚ,VerifyPyprojectDotTomlTests.test_nameMissing=   s&   € ó
ˆDð ×Ñœj¨$¯.©.¸$Ö?ó
r   c                ó°   € R F;  pV P                  \        R4      ;_uu_ 4        V P                  V4       RRR4       K=  	  R#   + '       g   i     KR  ; i)z=
`TypeError` is raised when the project name isn't a string.
z!The project name must be a stringN)z[project]
name = false
z[tool.incremental]
name = -1
z([tool.incremental]
[project]
name = 1.0
)ÚassertRaisesRegexÚ	TypeErrorr#   r.   s   & r   Útest_nameInvalidOptInÚ1VerifyPyprojectDotTomlTests.test_nameInvalidOptInJ   sF   € ó
ˆDð
 ×'Ñ'¬	Ð3V×WÕWØ—‘˜tÔ$÷ XÑWó
÷
 X×WÐWús   ¤AÁAc                óZ   € R F$  pV P                  \        V P                  V4       K&  	  R# )zU
`ValueError` is raised when the ``[tool]`` or ``[tool.incremental]``
isn't a table.
N)ztool = false
z[tool]
incremental = false
z[tool]
incremental = 123
z[tool]
incremental = null
r3   r.   s   & r   Útest_toolIncrementalInvalidÚ7VerifyPyprojectDotTomlTests.test_toolIncrementalInvalidV   s&   € ó

ˆDð ×Ñœj¨$¯.©.¸$Ö?ó
r   c                óZ   € R F$  pV P                  \        V P                  V4       K&  	  R# )z`
Raise `ValueError` when the ``[tool.incremental]`` section contains
keys other than ``"name"``
N)z[tool.incremental]
foo = false
z-[tool.incremental]
name = "OK"
other = false
r3   r.   s   & r   Ú!test_toolIncrementalUnexpecteKeysÚ=VerifyPyprojectDotTomlTests.test_toolIncrementalUnexpecteKeysc   s&   € ó

ˆDð ×Ñœj¨$¯.©.¸$Ö?ó	
r   c                ó  € \        V P                  4       4      pVR,          R,          pVP                  RR7       R
 FC  pV P                  W1R,          R7      pV P	                  V\        RR\        V4      R7      4       KE  	  R	# )zÁ
The package has opted-in to Incremental version management when
the ``[tool.incremental]`` section is a dict. The project name
is taken from ``[tool.incremental] name`` or ``[project] name``.
ÚsrcÚfooT©Úparentsr&   ©r   ÚFoo©Úopt_inÚpackager   N)z*[project]
name = "Foo"
[tool.incremental]
z [tool.incremental]
name = "Foo"
©r   r   Úmkdirr#   ÚassertEqualr   r   )r   ÚrootÚpkgr   Úconfigs   &    r   Útest_setuptoolsOptInÚ0VerifyPyprojectDotTomlTests.test_setuptoolsOptInn   sz   € ô �D—K‘K“MÓ"ˆØ�U�l˜UÕ"ˆØ�	‰	˜$ˆ	Ôó
ˆDð —^‘^ DÐ6FÕ/F�^ÓGˆFà×ÑØÜ"ØØ!Ü˜S›ôöó
r   c                ó  € \        V P                  4       4      pVP                  4        V P                  \        R4      ;_uu_ 4        V P                  RVR,          R7       RRR4       R#   + '       g   i     R# ; i)z=
Raise `ValueError` when the package root can't be resolved.
z$Can't find the directory of project z[project]
name = "foo"
r&   rG   N)r   r   rM   r8   r4   r#   )r   rO   s   & r   Útest_packagePathRequiredÚ4VerifyPyprojectDotTomlTests.test_packagePathRequired‡   s^   € ô �D—K‘K“MÓ"ˆØ�
‰
Œà×#Ñ#¤JÐ0V×WÕWØ�N‰NØ+ØÐ,Õ,ð ô ÷ X×W×WÒWús   ÁA-Á-A>	c           
     óþ   € \        V P                  4       4      pVR,          R,          pVP                  RR7       V P                  RVR,          R7      pV P	                  V\        RR	\        V4      R
7      4       R# )zl
The ``[tool.incremental]`` table is not strictly required, but its
``opt_in=False`` indicates its absence.
rC   rD   TrE   z[project]
name = "Foo"
r&   rG   FrH   rI   NrL   )r   rO   rP   rQ   s   &   r   Útest_noToolIncrementalSectionÚ9VerifyPyprojectDotTomlTests.test_noToolIncrementalSection”   sw   € ô
 �D—K‘K“MÓ"ˆØ�U�l˜UÕ"ˆØ�	‰	˜$ˆ	Ôà—‘Ø'ØÐ(Õ(ð  ó 
ˆð
 	×ÑØÜØØÜ˜“Xôö	
r   © )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r#   r+   r/   r5   r:   r=   r@   rR   rU   rX   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r
   r
      sP   ø‡ € Ù9ðØ;?÷ò ò8Iò;ò@ò
%ò@ò	@òò2÷
ð 
r   r
   )r_   r'   Útypingr   r   r   Úpathlibr   Útwisted.trial.unittestr   Úincrementalr   r   r
   rZ   r   r   Ú<module>rf      s*   ðñ 8ã 	ß (Ñ (Ý Ý +ç @ô[
 (ö [
r   