+
    üÐjT  ã                   óh   € R t ^ RIt^ RIHt ^ RIHt ^ RIHtHtH	t	H
t
Ht R R lt ! R R]4      tR# )	zW
Tests for L{twisted.web._stan} portion of the L{twisted.web.template}
implementation.
N©ÚNoReturn)ÚTestCase)ÚCDATAÚCharRefÚCommentÚFlattenableÚTagc                ó<   € V ^8„  d   QhR\         R\         R\        /# )é   ÚaÚkwÚreturn)r   r	   )Úformats   "Ú</usr/lib/python3/dist-packages/twisted/web/test/test_stan.pyÚ__annotate__r      s!   € ÷ "ñ "Œkð "¤ð "´ñ "ó    c                 ó$   € \        R4      ! V / VB # )z 
Produce a new tag for testing.
Úhello)r	   )r   r   s   *,r   Úprotor      s   € ô ˆwŒ<˜Ð!˜bÑ!Ð!r   c                   óü   a € ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )ÚTagTestsz
Tests for L{Tag}.
c                ó   <€ V ^8„  d   QhRR/# ©r   r   N© )r   Ú__classdict__s   "€r   r   ÚTagTests.__annotate__   s   ø€ ÷ -ñ - dñ -r   c                óŽ   € \        RR7      pV P                  VP                  R4       V P                  VP                  / 4       R# )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                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   &   s   ø€ ÷ 	
ñ 	
¨tñ 	
r   c                óê   € V P                  \        4      ;_uu_ 4       p\        ^SR7       RRR4       V P                  XP                  P
                  ^ ,          R4       R#   + '       g   i     L?; i)zj
Attempting to set an attribute named C{render} to something other than
a string will raise L{TypeError}.
r   Nz0Value for "render" attribute must be str, got 83)ÚassertRaisesÚ	TypeErrorr   r!   Ú	exceptionÚargs)r$   Úes   & r   Útest_renderAttributeNonStringÚ&TagTests.test_renderAttributeNonString&   sP   € ð
 ×Ñœy×)Ô)¨QÜ˜Õ÷ *à×ÑØ�K‰K×Ñ˜QÕÐ!Sö	
÷ *×)ús   žA"Á"A2	c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   1   s   ø€ ÷ >ñ > ñ >r   c                ó\   € \        4       pV P                  WP                  RR7      4       R# )z 
L{Tag.fillSlots} returns self.
Útest)r3   N)r   ÚassertIdenticalÚ	fillSlotsr#   s   & r   Útest_fillSlotsÚTagTests.test_fillSlots1   s$   € ô ‹gˆØ×Ñ˜S§-¡-°V -Ó"<Ö=r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   8   s   ø€ ÷ 8ñ 8 4ñ 8r   c                ót  € R.p\        RVRRR7      pVP                  RR7       RVn        ^Vn        ^Vn        VP                  R	R
7      pV P                  VP                  R,          R4       V P                  VP                  VP                  4       V P                  VP                  RV.4       V P                  VP                  VP                  4       V P                  VP                  ^,          V4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  R4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  R4       R# )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/barF)Údeepr   N©r   r5   ÚfilenameÚ
lineNumberÚcolumnNumberÚcloner!   r"   ÚassertNotIdenticalÚchildrenr4   ÚslotDatar    )r$   Ú	innerListr%   rH   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                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   Q   s   ø€ ÷  8ñ  8 ñ  8r   c                ó  € \        R4      pR.p\        RWRRR7      pVP                  RR7       R	Vn        ^Vn        ^Vn        VP                  4       pV P                  VP                  R
,          R4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  ^,          V4       V P                  VP                  ^,          V4       V P                  VP                  ^,          V4       V P                  VP                  ^,          V4       V P                  VP                  VP                  4       V P                  VP                  VP                  4       V P                  VP                  R	4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  R4       R# )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.
Úinnerr:   r;   r<   r=   r>   r?   r@   rB   r   NrD   )r$   ÚinnerTagrL   r%   rH   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                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   s   s   ø€ ÷ 
ñ 
°ñ 
r   c                óÚ   € \        R \        ^
4       4       4      pV P                  \        R\        P
                  \        P                  ,          P                  VP                  4       R# )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   "  € T F  p\        V4      x € K  	  R # 5i©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__rH   r#   s   & r   Útest_cloneGeneratorDeprecationÚ'TagTests.test_cloneGeneratorDeprecations   sM   € ô Ñ.¤E¨"¤IÓ.Ó.ˆØ×ÑÜð)ô �K‰KœŸ™Õ'×0Ñ0Ø�I‰Iö	
r   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   „   s   ø€ ÷ ñ °ñ r   c                ó$  € R R lpV! 4       p\        RVR4      p V P                  \        R\        P                  \
        P                  ,          P                  VP                  4       VP                  4        R#   TP                  4        i ; i)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.
c                ó$   € V ^8„  d   QhR\         /# )r   r   r   )r   s   "r   r   Ú=TagTests.test_cloneCoroutineDeprecation.<locals>.__annotate__‹   s   € ÷ 	&ñ 	&¤ñ 	&r   c               “   ó   "  € \         h5irX   )ÚNotImplementedErrorr   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_   r`   ra   rb   r	   rc   rd   rH   Úclose)r$   rm   Úcoror%   s   &   r   Útest_cloneCoroutineDeprecationÚ'TagTests.test_cloneCoroutineDeprecation„   sm   € õ	&ñ ‹{ˆÜ�E˜4 Ó'ˆð	Ø×ÑÜ"ð-ô —‘œCŸN™NÕ+×4Ñ4Ø—	‘	ôð �J‰JŽLøˆD�J‰J�Lús   œAA= Á=Bc                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   �   s   ø€ ÷ Hñ H˜Dñ Hr   c                ó¸   € \        RRRRR7      pVP                  4        V P                  VP                  . 4       V P                  VP                  RR/4       R# )zS
L{Tag.clear} removes all children from a tag, but leaves its attributes
in place.
z	these arerJ   Úcoolzthis-attribute)ÚandSoIsrx   N)r   Úclearr!   rJ   r"   r#   s   & r   Ú
test_clearÚTagTests.test_clear�   sL   € ô
 �K ¨VÐ=MÔNˆØ�	‰	ŒØ×Ñ˜Ÿ™ rÔ*Ø×Ñ˜Ÿ™¨)Ð5EÐ)FÖGr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   §   s   ø€ ÷ 9ñ 9˜Tñ 9r   c                óx   € \        R4      pV! 4       pV! RR7       V P                  VP                  RR/4       R# )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                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   ±   s   ø€ ÷ Qñ Q Tñ Qr   c                óN   € V P                  \        \        R4      4      R4       R# )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                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   ¸   s   ø€ ÷ Iñ I 4ñ Ir   c                óN   € V P                  \        \        R4      4      R4       R# )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!   r…   r   r†   s   &r   Útest_cdataReprPy3ÚTagTests.test_cdataReprPy3¸   s   € ð
 	×Ñœœe KÓ0Ó1Ð3GÖHr   c                ó   <€ V ^8„  d   QhRR/# r   r   )r   r   s   "€r   r   r   ¿   s   ø€ ÷ Bñ B $ñ Br   c                ód   € \        R4      pV P                  \        \        V4      4      R4       R# )z_
L{CharRef.__repr__} returns a value which makes it easy to see what
character is referred to.
u   â˜ƒzCharRef(9731)N)Úordr!   r…   r   )r$   Úsnowmans   & r   Útest_charrefReprÚTagTests.test_charrefRepr¿   s(   € ô
 �mÓ$ˆØ×Ñœœg gÓ.Ó/°ÖAr   r   N)Ú__name__rc   Ú__qualname__Ú__firstlineno__Ú__doc__r&   r/   r6   rM   rS   re   rs   rz   r�   r‡   r‹   r‘   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s‹   ø‡ € ñ÷-ð -÷	
ð 	
÷>ð >÷8ð 8÷2 8ð  8÷D
ð 
÷"ð ÷2Hð H÷9ð 9÷Qð Q÷Ið I÷Bö Br   r   )r–   ra   Útypingr   Útwisted.trial.unittestr   Útwisted.web.templater   r   r   r   r	   r   r   r   r   r   Ú<module>rœ      s0   ðñó Ý å +ß JÕ Jõ"ômBˆxö mBr   