404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.145.168.68: ~ $
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)#�MarkupTestCasecCsd}td�}dS)Nz?<script type="application/x-some-script">alert("foo");</script>z<em>username</em>)r)�selfZunsafeZsafe�r�/usr/lib64/python3.6/tests.py�test_addingszMarkupTestCase.test_addingcCsdS)Nr)rrrr	�test_string_interpolations	z(MarkupTestCase.test_string_interpolationcCstd�}dS)N�foo)r)r�xrrr	�test_type_behaviorsz!MarkupTestCase.test_type_behaviorcCsGdd�dt�}dS)Nc@s eZdZdd�Zdd�ZeZdS)z-MarkupTestCase.test_html_interop.<locals>.FoocSsdS)Nz<em>awesome</em>r)rrrr	�__html__'sz6MarkupTestCase.test_html_interop.<locals>.Foo.__html__cSsdS)N�awesomer)rrrr	�__unicode__)sz9MarkupTestCase.test_html_interop.<locals>.Foo.__unicode__N)�__name__�
__module__�__qualname__rr�__str__rrrr	�Foo&sr)�object)rrrrr	�test_html_interop$sz 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)rrrr	�test_tuple_interpol0s
z"MarkupTestCase.test_tuple_interpolcCs>|jtd�dditd��|jtd�ddd�td��dS)	Nz<em>%(foo)s</em>rz<foo>z<em>&lt;foo&gt;</em>z<em>%(foo)s:%(bar)s</em>z<bar>)r�barz <em>&lt;foo&gt;:&lt;bar&gt;</em>)rr)rrrr	�test_dict_interpol6s


z!MarkupTestCase.test_dict_interpolcCsdS)Nr)rrrr	�
test_escaping?szMarkupTestCase.test_escapingc
Cs�x�td�ddftd�ddftd�ddftd�jd
d�dftd�jdddig�dftd�jddtd�ig�dffD]\}}qvWdS)Nz%ig��Q�	@�3z%.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;)r!r"r#)r�format)r�actualZexpectedrrr	�test_formattingEszMarkupTestCase.test_formatting��cCstd�jd�}dS)Nz{}r)rr$)rZ	formattedrrr	�test_formatting_emptyTsz$MarkupTestCase.test_formatting_emptycCs$Gdd�dt�}Gdd�dt�}dS)Nc@seZdZdd�ZdS)z:MarkupTestCase.test_custom_formatting.<locals>.HasHTMLOnlycSstd�S)Nz<foo>)r)rrrr	rZszCMarkupTestCase.test_custom_formatting.<locals>.HasHTMLOnly.__html__N)rrrrrrrr	�HasHTMLOnlyYsr*c@seZdZdd�Zdd�ZdS)z?MarkupTestCase.test_custom_formatting.<locals>.HasHTMLAndFormatcSstd�S)Nz<foo>)r)rrrr	r^szHMarkupTestCase.test_custom_formatting.<locals>.HasHTMLAndFormat.__html__cSstd�S)Nz<FORMAT>)r)r�specrrr	�__html_format__`szOMarkupTestCase.test_custom_formatting.<locals>.HasHTMLAndFormat.__html_format__N)rrrrr,rrrr	�HasHTMLAndFormat]sr-)r)rr*r-rrr	�test_custom_formattingXsz%MarkupTestCase.test_custom_formattingcCsGdd�dt�}|dd�}dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)z;MarkupTestCase.test_complex_custom_formatting.<locals>.UsercSs||_||_dS)N)�id�username)rr/r0rrr	�__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$r/r�
ValueError)r�format_specrrr	r,ks
zKMarkupTestCase.test_complex_custom_formatting.<locals>.User.__html_format__cSstd�j|j�S)Nz<span class=user>{0}</span>)rr$r0)rrrr	rtszDMarkupTestCase.test_complex_custom_formatting.<locals>.User.__html__N)rrrr1r,rrrrr	�Usergs	r5�r)r)rr5�userrrr	�test_complex_custom_formattingfs
z-MarkupTestCase.test_complex_custom_formattingcCs&ddl}x|jD]}t||�qWdS)Nr)�
markupsafe�__all__�getattr)rZmarkup�itemrrr	�test_all_set{szMarkupTestCase.test_all_setcCsdS)Nr)rrrr	�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)rr�split�rsplit�
splitlines)rrrr	�test_splitting�szMarkupTestCase.test_splittingcCs|jtd�dtd��dS)Nr?�Zaaa)rr)rrrr	�test_mul�szMarkupTestCase.test_mulN)r'r()rrrr
rrrrrrr&�sys�version_infor)r.r8r=r>rDrFrrrr	r	s 	
rc@seZdZdd�ZdS)�MarkupLeakTestCasecCs`t�}xTtd�D]H}x0td�D]$}td�td�td�td�qW|jttj���qWdS)N�i�rz<foo>)�set�ranger�add�len�gcZget_objects)rZcounts�countr<rrr	�test_markup_leaks�sz$MarkupLeakTestCase.test_markup_leaksN)rrrrQrrrr	rI�srIcCs6tj�}|jtjt��ttd�s2|jtjt��|S)NZ	func_code)�unittestZ	TestSuiteZaddTestZ	makeSuiter�hasattrrrI)�suiterrr	rT�s

rT�__main__)ZdefaultTest)rOrGrRr9rrrZmarkupsafe._compatrZTestCaserrIrTr�mainrrrr	�<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