+
    üÐj@  ã                   óˆ   € R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
HtHt ^ RIHt ^ RIHt R R	 lt ! R
 R]4      tR# )z
Test L{twisted.web.pages}
)Úcast)ÚSynchronousTestCase)ÚHeaders)ÚIRequest)Ú	errorPageÚ	forbiddenÚnotFound)Ú	IResource)ÚDummyRequestc                ó0   € V ^8„  d   QhR\         R\        /# )é   ÚresourceÚreturn)r	   r
   )Úformats   "Ú=/usr/lib/python3/dist-packages/twisted/web/test/test_pages.pyÚ__annotate__r      s   € ÷ ñ ”ið ¤Lñ ó    c                ó\   € \        R.4      pV P                  \        \        V4      4       V# )zœ
Render a response using the given resource.

@param resource: The resource to use to handle the request.

@returns: The request that the resource handled,
r   )r
   Úrenderr   r   )r   Úrequests   & r   Ú_renderr      s*   € ô ˜C˜5Ó!€Gð ‡O�O”Dœ 7Ó+Ô,Ø€Nr   c                   ó‚   a € ] tR t^"t o Rt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
RtV tR# )ÚErrorPageTestszi
Test L{twisted.web.pages._ErrorPage} and its public aliases L{errorPage},
L{notFound} and L{forbidden}.
Nc                ó0   <€ V ^8„  d   QhRS[ RS[RS[RR/# )r   r   ÚcodeÚbodyr   N)r
   ÚintÚbytes)r   Ú__classdict__s   "€r   r   ÚErrorPageTests.__annotate__*   s)   ø€ ÷ 
ñ 
¡lð 
¹#ð 
ÁUð 
Ètñ 
r   c                ó   € V P                  VP                  V4       V P                  VP                  \        R R./4      4       V P                  RP	                  VP
                  4      P                  R4      VP                  R4      4       R# )s   content-types   text/html; charset=utf-8r   zlatin-1N)ÚassertEqualÚresponseCodeÚresponseHeadersr   ÚjoinÚwrittenÚdecode)Úselfr   r   r   s   &&&&r   ÚassertResponseÚErrorPageTests.assertResponse*   sy   € Ø×Ñ˜×-Ñ-¨tÔ4Ø×ÑØ×#Ñ#Ü�_Ð'BÐ&CÐDÓEô	
ð 	×Ñð �H‰H�W—_‘_Ó%×,Ñ,¨YÓ7Ø�K‰K˜	Ó"ö		
r   c                ó   <€ V ^8„  d   QhRR/# ©r   r   N© )r   r   s   "€r   r   r   7   s   ø€ ÷ 
ñ 
 $ñ 
r   c           	     óT   € V P                  \        \        RRR4      4      RR4       R# )zC
The I{brief} and I{detail} parameters are HTML-escaped on render.
i�  zA & Bz<script>alert('oops!')sŠ   <!DOCTYPE html>
<html><head><title>400 - A &amp; B</title></head><body><h1>A &amp; B</h1><p>&lt;script&gt;alert('oops!')</p></body></html>N)r(   r   r   ©r'   s   &r   Útest_escapesHTMLÚErrorPageTests.test_escapesHTML7   s,   € ð 	×ÑÜ”I˜c 7Ð,DÓEÓFØð&ö			
r   c                ó   <€ V ^8„  d   QhRR/# r+   r,   )r   r   s   "€r   r   r   F   s   ø€ ÷ 	
ñ 	
˜tñ 	
r   c                ó”   € \        RRR4      pV P                  VP                  R\        \        \        R.4      4      4      V4       R# )zl
The C{getChild} method of the resource returned by L{errorPage} returns
the L{_ErrorPage} it is called on.
é”  ÚfooÚbars   namer   N)r   ÚassertIsÚgetChildr   r   r
   )r'   Úpages   & r   Útest_getChildÚErrorPageTests.test_getChildF   s=   € ô
 ˜˜e UÓ+ˆØ�‰Ø�M‰M˜'¤4¬´,À¸uÓ2EÓ#FÓGØö	
r   c                ó   <€ V ^8„  d   QhRR/# r+   r,   )r   r   s   "€r   r   r   Q   s   ø€ ÷ 
ñ 
 tñ 
r   c                óN   € V P                  \        \        4       4      RR4       R# )zY
The default arguments to L{twisted.web.pages.notFound} produce
a reasonable error page.
r3   s¡   <!DOCTYPE html>
<html><head><title>404 - No Such Resource</title></head><body><h1>No Such Resource</h1><p>Sorry. No luck finding that resource.</p></body></html>N)r(   r   r   r.   s   &r   Útest_notFoundDefaultsÚ$ErrorPageTests.test_notFoundDefaultsQ   s$   € ð
 	×ÑÜ”H“JÓØð"ö	
	
r   c                ó   <€ V ^8„  d   QhRR/# r+   r,   )r   r   s   "€r   r   r   b   s   ø€ ÷ 
ñ 
¨ñ 
r   c                óN   € V P                  \        \        4       4      RR4       R# )zZ
The default arguments to L{twisted.web.pages.forbidden} produce
a reasonable error page.
i“  s�   <!DOCTYPE html>
<html><head><title>403 - Forbidden Resource</title></head><body><h1>Forbidden Resource</h1><p>Sorry, resource is forbidden.</p></body></html>N)r(   r   r   r.   s   &r   Útest_forbiddenDefaultsÚ%ErrorPageTests.test_forbiddenDefaultsb   s$   € ð
 	×ÑÜ”I“KÓ Øð"ö	
	
r   r,   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__ÚmaxDiffr(   r/   r9   r=   rA   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r   "   sC   ø‡ € ñð
 €G÷
ð 
÷
ð 
÷	
ð 	
÷
ð 
÷"
ö 
r   r   N)rG   Útypingr   Útwisted.trial.unittestr   Útwisted.web.http_headersr   Útwisted.web.iwebr   Útwisted.web.pagesr   r   r   Útwisted.web.resourcer	   Útwisted.web.test.requesthelperr
   r   r   r,   r   r   Ú<module>rR      s8   ðñõ å 6Ý ,Ý %ß <Ñ <Ý *Ý 7õô O
Ð(ö O
r   