ó
    ×›‘hT  ã                   óp   • S r SSKrSSKJr  SSKJr  SSKJrJrJ	r	J
r
Jr  S\
S\
S\4S	 jr " S
 S\5      rg)zW
Tests for L{twisted.web._stan} portion of the L{twisted.web.template}
implementation.
é    N)ÚNoReturn)ÚTestCase)ÚCDATAÚCharRefÚCommentÚFlattenableÚTagÚaÚkwÚreturnc                  ó$   • [        S5      " U 0 UD6$ )z 
Produce a new tag for testing.
Úhello)r	   )r
   r   s     Ú^C:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/web/test/test_stan.pyÚprotor      s   € ô ˆwŒ<˜Ð!˜bÑ!Ð!ó    c                   ó�   • \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSS jrSS jrSS jrSS jrSS jrSrg)ÚTagTestsé   z
Tests for L{Tag}.
Nc                 ó†   • [        SS9nU R                  UR                  S5        U R                  UR                  0 5        g)zr
Setting an attribute named C{render} will change the C{render} instance
variable instead of adding an attribute.
Ú
myRenderer©ÚrenderN)r   ÚassertEqualr   Ú
attributes©ÚselfÚtags     r   Útest_renderAttributeÚTagTests.test_renderAttribute   s6   € ô
 ˜<Ñ(ˆØ×Ñ˜Ÿ™ \Ô2Ø×Ñ˜Ÿ™¨Õ,r   c                 óÆ   • U R                  [        5       n[        SS9  SSS5        U R                  WR                  R
                  S   S5        g! , (       d  f       N8= f)zj
Attempting to set an attribute named C{render} to something other than
a string will raise L{TypeError}.
éS   r   Nr   z0Value for "render" attribute must be str, got 83)ÚassertRaisesÚ	TypeErrorr   r   Ú	exceptionÚargs)r   Úes     r   Útest_renderAttributeNonStringÚ&TagTests.test_renderAttributeNonString&   sM   € ð
 ×ÑœyÔ)¨QÜ˜Ò÷ *à×ÑØ�K‰K×Ñ˜QÑÐ!Sõ	
÷ *Õ)ús   –
AÁ
A c                 óT   • [        5       nU R                  XR                  SS95        g)z 
L{Tag.fillSlots} returns self.
Útest)r*   N)r   ÚassertIdenticalÚ	fillSlotsr   s     r   Útest_fillSlotsÚTagTests.test_fillSlots1   s$   € ô ‹gˆØ×Ñ˜S§-¡-°V -Ð"<Õ=r   c                 óP  • S/n[        SUSSS9nUR                  SS9  SUl        S	Ul        S
Ul        UR                  SS9nU R                  UR                  S   S5        U R                  UR                  UR                  5        U R                  UR                  SU/5        U R                  UR                  UR                  5        U R                  UR                  S   U5        U R                  UR                  UR                  5        U R                  UR                  UR                  5        U R                  UR                  S5        U R                  UR                  S	5        U R                  UR                  S
5        U R                  UR                  S5        g)z”
L{Tag.clone} copies all attributes and children of a tag, including its
render attribute.  If the shallow flag is C{False}, that's where it
stops.
ú
inner listúHow are youÚworldÚaSampleMethod©r   r   Úbar©Úfooúfoo/baré   é   F)Údeepr   é   N©r   r,   ÚfilenameÚ
lineNumberÚcolumnNumberÚcloner   r   ÚassertNotIdenticalÚchildrenr+   ÚslotDatar   )r   Ú	innerListr   rA   s       r   Útest_cloneShallowÚTagTests.test_cloneShallow8   sR  € ð "�Nˆ	Ü�M 9°GÀOÑTˆØ�‰˜%ˆÑ Ø ˆŒØˆŒØˆÔØ—	‘	˜u�	Ð%ˆØ×Ñ˜×)Ñ)¨'Ñ2°GÔ<Ø×Ñ × 0Ñ 0°#·.±.ÔAØ×Ñ˜Ÿ™¨-¸Ð)CÔDØ×Ñ §¡°·±Ô=Ø×Ñ˜UŸ^™^¨AÑ.°	Ô:Ø×Ñ˜Ÿ™ u§~¡~Ô6Ø×Ñ §¡¨e¯n©nÔ=Ø×Ñ˜Ÿ™¨Ô3Ø×Ñ˜×)Ñ)¨1Ô-Ø×Ñ˜×+Ñ+¨RÔ0Ø×Ñ˜Ÿ™ Õ7r   c                 óæ  • [        S5      nS/n[        SXSSS9nUR                  SS9  S	Ul        S
Ul        SUl        UR                  5       nU R                  UR                  S   S5        U R                  UR                  UR                  5        U R                  UR                  UR                  5        U R                  UR                  S   U5        U R                  UR                  S   U5        U R                  UR                  S   U5        U R                  UR                  S   U5        U R                  UR                  UR                  5        U R                  UR                  UR                  5        U R                  UR                  S	5        U R                  UR                  S
5        U R                  UR                  S5        U R                  UR                  S5        g)zØ
L{Tag.clone} copies all attributes and children of a tag, including its
render attribute.  In its normal operating mode (where the deep flag is
C{True}, as is the default), it will clone all sub-lists and sub-tags.
Úinnerr0   r1   r2   r3   r4   r5   r6   r8   r9   r:   r   r<   é   Nr=   )r   ÚinnerTagrE   r   rA   s        r   Útest_cloneDeepÚTagTests.test_cloneDeepQ   s‹  € ô ˜“>ˆØ!�Nˆ	ÜØ˜8°gÀoñ
ˆð 	�‰˜%ˆÑ Ø ˆŒØˆŒØˆÔØ—	‘	“ˆØ×Ñ˜×)Ñ)¨'Ñ2°GÔ<Ø×Ñ × 0Ñ 0°#·.±.ÔAØ×Ñ §¡°·±Ô=à×Ñ˜SŸ\™\¨!™_¨hÔ7à×Ñ §¡¨qÑ 1°8Ô<à×Ñ˜SŸ\™\¨!™_¨iÔ8à×Ñ §¡¨qÑ 1°9Ô=Ø×Ñ˜Ÿ™ u§~¡~Ô6Ø×Ñ §¡¨e¯n©nÔ=Ø×Ñ˜Ÿ™¨Ô3Ø×Ñ˜×)Ñ)¨1Ô-Ø×Ñ˜×+Ñ+¨RÔ0Ø×Ñ˜Ÿ™ Õ7r   c                 óÐ   • [        S [        S5       5       5      nU R                  [        S[        R
                  [        R                     R                  UR                  5        g)zÌ
Cloning a tag containing a generator is unsafe. To avoid breaking
programs that only flatten the clone or only flatten the original,
we deprecate old behavior rather than making it an error immediately.
c              3   ó8   #   • U  H  n[        U5      v •  M     g 7f©N)Ústr)Ú.0Úns     r   Ú	<genexpr>Ú:TagTests.test_cloneGeneratorDeprecation.<locals>.<genexpr>y   s   é € Ð.¢I˜q”C˜—F�F¢Iùs   ‚é
   z´Cloning a Tag which contains a generator is unsafe, since the generator can be consumed only once; this is deprecated since Twisted 21.7.0 and will raise an exception in the futureN)
r   ÚrangeÚassertWarnsÚDeprecationWarningÚsysÚmodulesr	   Ú
__module__Ú__file__rA   r   s     r   Útest_cloneGeneratorDeprecationÚ'TagTests.test_cloneGeneratorDeprecations   sM   € ô Ñ.¤E¨"¤IÓ.Ó.ˆØ×ÑÜð)ô �K‰KœŸ™Ñ'×0Ñ0Ø�I‰Iõ	
r   c                 ó$  • S[         4S jnU" 5       n[        SUS5      n U R                  [        S[        R
                  [        R                     R                  UR                  5        UR                  5         g! UR                  5         f = f)zÌ
Cloning a tag containing a coroutine is unsafe. To avoid breaking
programs that only flatten the clone or only flatten the original,
we deprecate old behavior rather than making it an error immediately.
r   c               “   ó   #   • [         e7frP   )ÚNotImplementedError© r   r   Ú	asyncFuncÚ:TagTests.test_cloneCoroutineDeprecation.<locals>.asyncFunc‹   s   é € Ü%Ð%ùs   ‚	Ú123Ú789z¬Cloning a Tag which contains a coroutine is unsafe, since the coroutine can run only once; this is deprecated since Twisted 21.7.0 and will raise an exception in the futureN)r   r   rX   rY   rZ   r[   r	   r\   r]   rA   Úclose)r   rd   Úcoror   s       r   Útest_cloneCoroutineDeprecationÚ'TagTests.test_cloneCoroutineDeprecation„   st   € ð	&¤ô 	&ñ ‹{ˆÜ�E˜4 Ó'ˆð	Ø×ÑÜ"ð-ô —‘œCŸN™NÑ+×4Ñ4Ø—	‘	ôð �J‰J�LøˆD�J‰J�Lús   ¡AA= Á=Bc                 ó°   • [        SSSSS9nUR                  5         U R                  UR                  / 5        U R                  UR                  SS05        g)zS
L{Tag.clear} removes all children from a tag, but leaves its attributes
in place.
z	these arerC   Úcoolzthis-attribute)ÚandSoIsrn   N)r   Úclearr   rC   r   r   s     r   Ú
test_clearÚTagTests.test_clear�   sL   € ô
 �K ¨VÐ=MÑNˆØ�	‰	ŒØ×Ñ˜Ÿ™ rÔ*Ø×Ñ˜Ÿ™¨)Ð5EÐ)FÕGr   c                 óp   • [        S5      nU" 5       nU" SS9  U R                  UR                  SS05        g)zq
L{Tag.__call__} accepts Python keywords with a suffixed underscore as
the DOM attribute of that literal suffix.
Údivr
   )Úclass_ÚclassN)r	   r   r   )r   r   r   s      r   Útest_suffixÚTagTests.test_suffix§   s3   € ô
 �E“
ˆÙ‹gˆÙ�3ŠØ×Ñ˜Ÿ™¨'°3¨Õ8r   c                 óL   • U R                  [        [        S5      5      S5        g)zW
L{Comment.__repr__} returns a value which makes it easy to see what's
in the comment.
zhello therezComment('hello there')N)r   Úreprr   ©r   s    r   Útest_commentReprPy3ÚTagTests.test_commentReprPy3±   s   € ð
 	×Ñœœg mÓ4Ó5Ð7OÕPr   c                 óL   • U R                  [        [        S5      5      S5        g)zU
L{CDATA.__repr__} returns a value which makes it easy to see what's in
the comment.
z	test datazCDATA('test data')N)r   ry   r   rz   s    r   Útest_cdataReprPy3ÚTagTests.test_cdataReprPy3¸   s   € ð
 	×Ñœœe KÓ0Ó1Ð3GÕHr   c                 ób   • [        S5      nU R                  [        [        U5      5      S5        g)z_
L{CharRef.__repr__} returns a value which makes it easy to see what
character is referred to.
u   â˜ƒzCharRef(9731)N)Úordr   ry   r   )r   Úsnowmans     r   Útest_charrefReprÚTagTests.test_charrefRepr¿   s(   € ô
 �mÓ$ˆØ×Ñœœg gÓ.Ó/°ÕAr   rc   )r   N)Ú__name__r\   Ú__qualname__Ú__firstlineno__Ú__doc__r   r'   r-   rF   rL   r^   rj   rp   rv   r{   r~   rƒ   Ú__static_attributes__rc   r   r   r   r      sH   † ñô-ô	
ô>ô8ô2 8ôD
ô"ô2Hô9ôQôI÷Br   r   )rˆ   rZ   Útypingr   Útwisted.trial.unittestr   Útwisted.web.templater   r   r   r   r	   r   r   rc   r   r   Ú<module>r�      sE   ðñó Ý å +ß JÕ Jð"ˆkð " ð "°ô "ômBˆxõ mBr   