404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.129.23.179: ~ $
3

��kS��@s|ddlZddlZddlZddlmZmZmZddlmZGdd�dej	�Z
Gdd�dej	�Zdd	�Ze
d
krxejd	d�dS)�N)�Markup�escape�
escape_silent)�	text_typec@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ejd"krZdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)#�MarkupTestCasecCs0d}td�}||tt|��t|�ks,t�dS)Nz?<script type="application/x-some-script">alert("foo");</script>z<em>username</em>)rrr�AssertionError)�selfZunsafeZsafe�r	�/usr/lib64/python3.6/tests.py�test_addingszMarkupTestCase.test_addingcCsXtd�ddkst�td�ddidks,t�td�ddks@t�td	�dd
ksTt�dS)Nz<em>%s</em>z
<bad user>z<em>&lt;bad user&gt;</em>z<em>%(username)s</em>�usernamez%ig��Q�	@�3z%.2fz3.14)rr)rr	r	r
�test_string_interpolations


z(MarkupTestCase.test_string_interpolationcCs4ttd�d�tkst�td�}|j�|ks0t�dS)N�foo�bar)�typerr�__html__)r�xr	r	r
�test_type_behaviorsz!MarkupTestCase.test_type_behaviorcCs<Gdd�dt�}t|��dks"t�td�|�dks8t�dS)Nc@s eZdZdd�Zdd�ZeZdS)z-MarkupTestCase.test_html_interop.<locals>.FoocSsdS)Nz<em>awesome</em>r	)rr	r	r
r'sz6MarkupTestCase.test_html_interop.<locals>.Foo.__html__cSsdS)N�awesomer	)rr	r	r
�__unicode__)sz9MarkupTestCase.test_html_interop.<locals>.Foo.__unicode__N)�__name__�
__module__�__qualname__rr�__str__r	r	r	r
�Foo&srz<em>awesome</em>z<strong>%s</strong>z!<strong><em>awesome</em></strong>)�objectrr)rrr	r	r
�test_html_interop$sz MarkupTestCase.test_html_interopcCs|jtd�dtd��dS)Nz<em>%s:%s</em>�<foo>�<bar>z <em>&lt;foo&gt;:&lt;bar&gt;</em>)rr)�assertEqualr)rr	r	r
�test_tuple_interpol0s
z"MarkupTestCase.test_tuple_interpolcCs>|jtd�dditd��|jtd�ddd�td��dS)	Nz<em>%(foo)s</em>rz<foo>z<em>&lt;foo&gt;</em>z<em>%(foo)s:%(bar)s</em>z<bar>)rrz <em>&lt;foo&gt;:&lt;bar&gt;</em>)r r)rr	r	r
�test_dict_interpol6s


z!MarkupTestCase.test_dict_interpolcCs<td�dkst�td�j�dks$t�td�j�dks8t�dS)Nz"<>&'z&#34;&lt;&gt;&amp;&#39;z<em>Foo &amp; Bar</em>z	Foo & Barz&lt;test&gt;z<test>)rrrZ	striptagsZunescape)rr	r	r
�
test_escaping?szMarkupTestCase.test_escapingc
Cs�x�td�ddftd�ddftd�ddftd�jd
d�dftd�jdddig�dftd�jddtd�ig�dffD] \}}||ksvtd||f��qvWdS)Nz%ig��Q�	@r
z%.2fgn��!	@z3.14z%s %s %s�<�{�>z
&lt; 123 &gt;z<em>{awesome}</em>z	<awesome>)rz<em>&lt;awesome&gt;</em>z{0[1][bar]}rrz<bar/>z&lt;bar/&gt;z%r should be %r!)r$r%r&)r�formatr)r�actualZexpectedr	r	r
�test_formattingEszMarkupTestCase.test_formatting��cCs"td�jd�}|td�kst�dS)Nz{}r�0)rr'r)rZ	formattedr	r	r
�test_formatting_emptyTsz$MarkupTestCase.test_formatting_emptycCs\Gdd�dt�}Gdd�dt�}td�j|��td�ks<t�td�j|��td�ksXt�dS)Nc@seZdZdd�ZdS)z:MarkupTestCase.test_custom_formatting.<locals>.HasHTMLOnlycSstd�S)Nz<foo>)r)rr	r	r
rZszCMarkupTestCase.test_custom_formatting.<locals>.HasHTMLOnly.__html__N)rrrrr	r	r	r
�HasHTMLOnlyYsr.c@seZdZdd�Zdd�ZdS)z?MarkupTestCase.test_custom_formatting.<locals>.HasHTMLAndFormatcSstd�S)Nz<foo>)r)rr	r	r
r^szHMarkupTestCase.test_custom_formatting.<locals>.HasHTMLAndFormat.__html__cSstd�S)Nz<FORMAT>)r)r�specr	r	r
�__html_format__`szOMarkupTestCase.test_custom_formatting.<locals>.HasHTMLAndFormat.__html_format__N)rrrrr0r	r	r	r
�HasHTMLAndFormat]sr1z{0}z<foo>z<FORMAT>)rrr'r)rr.r1r	r	r
�test_custom_formattingXsz%MarkupTestCase.test_custom_formattingcCs8Gdd�dt�}|dd�}td�j|�td�ks4t�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z;MarkupTestCase.test_complex_custom_formatting.<locals>.UsercSs||_||_dS)N)�idr)rr3rr	r	r
�__init__hszDMarkupTestCase.test_complex_custom_formatting.<locals>.User.__init__cSs2|dkrtd�j|j|j��S|r*td��|j�S)N�linkz<a href="/user/{0}">{1}</a>zInvalid format spec)rr'r3r�
ValueError)r�format_specr	r	r
r0ks
zKMarkupTestCase.test_complex_custom_formatting.<locals>.User.__html_format__cSstd�j|j�S)Nz<span class=user>{0}</span>)rr'r)rr	r	r
rtszDMarkupTestCase.test_complex_custom_formatting.<locals>.User.__html__N)rrrr4r0rr	r	r	r
�Usergs	r8�rz<p>User: {0:link}z:<p>User: <a href="/user/1"><span class=user>foo</span></a>)rrr'r)rr8�userr	r	r
�test_complex_custom_formattingfs
z-MarkupTestCase.test_complex_custom_formattingcCs&ddl}x|jD]}t||�qWdS)Nr)�
markupsafe�__all__�getattr)rZmarkup�itemr	r	r
�test_all_set{szMarkupTestCase.test_all_setcCs>td�t�kst�td�td�ks&t�td�td�ks:t�dS)Nz<foo>z&lt;foo&gt;)rrrr)rr	r	r
�test_escape_silent�sz!MarkupTestCase.test_escape_silentcCsd|jtd�j�td�td�g�|jtd�j�td�td�g�|jtd�j�td�td�g�dS)Nza b�a�bza
b)r r�split�rsplit�
splitlines)rr	r	r
�test_splitting�szMarkupTestCase.test_splittingcCs|jtd�dtd��dS)NrB�Zaaa)r r)rr	r	r
�test_mul�szMarkupTestCase.test_mulN)r*r+)rrrrrrrr!r"r#r)�sys�version_infor-r2r;r@rArGrIr	r	r	r
r	s 	
rc@seZdZdd�ZdS)�MarkupLeakTestCasecCstt�}xTtd�D]H}x0td�D]$}td�td�td�td�qW|jttj���qWt|�dksptd��dS)N�i�rz<foo>r9z'ouch, c extension seems to leak objects)�set�ranger�add�len�gcZget_objectsr)rZcounts�countr?r	r	r
�test_markup_leaks�sz$MarkupLeakTestCase.test_markup_leaksN)rrrrTr	r	r	r
rL�srLcCs6tj�}|jtjt��ttd�s2|jtjt��|S)NZ	func_code)�unittestZ	TestSuiteZaddTestZ	makeSuiter�hasattrrrL)�suiter	r	r
rW�s

rW�__main__)ZdefaultTest)rRrJrUr<rrrZmarkupsafe._compatrZTestCaserrLrWr�mainr	r	r	r
�<module>s

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 11.05 KB 0644
__init__.cpython-36.pyc File 11.05 KB 0644
_compat.cpython-36.opt-1.pyc File 737 B 0644
_compat.cpython-36.pyc File 737 B 0644
_constants.cpython-36.opt-1.pyc File 4.2 KB 0644
_constants.cpython-36.pyc File 4.2 KB 0644
_native.cpython-36.opt-1.pyc File 1.34 KB 0644
_native.cpython-36.pyc File 1.34 KB 0644
tests.cpython-36.opt-1.pyc File 6.8 KB 0644
tests.cpython-36.pyc File 7.88 KB 0644