+
    Df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 *KK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 84 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	M9GOT%  		u	%))'2G< 0 0#..A-)CD=U^^A.	:u~~6enn=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	8go
 	%  		))'2G< 0 0#..A=S\\!_h7q 18<S\\!_i8q 19=u~~6enn=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     .IqCFFIs   zCloning 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..) KK'00II	
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789zCloning 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    	& {E4'	"- CNN+44		 JJLDJJLs   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 9T 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    
 	gm457O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    
 	eK013G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$gg./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 82 8  8D
 
" 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   