Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
escape_test.cpython-313.pyc58 linesDownload Raw Back to __pycache__
1�

2��jn1��2�SSKrSSKrSSKJrJrJrJrJrJrJ	r	J3r4JrJr SSK
Jr SSKJrJrJrJrJr /S0S4PS0S4PS	0S54PS0S4PS
0S4PS0S4PS0S4PS0S4PS0S4PS0S4PS0S4PS0S4PS0S4PS0S 4PS!0S"4PS#0S$4PS%0S&4PS'S(S)S*/0S+4PS,S(S*/0S-4PS.0S/4PS00S14PS20S34PS40S54PS6S(S)S7/0S84PS90S:4PS;0S<4PS=0S>4PS=S?S@0S=4PSAS@S@SB.SC4PSDSES@0SF4PSG0SH4PSGS(SI/0SJ4PSKSLSM0SN4PSOSLSP0SQ4PSKSLSR0SN4Pr"SSST\R,5rg)U�N)6�utf8�xhtml_escape�xhtml_unescape�7url_escape�url_unescape�8to_unicode�json_decode�json_encode�squeeze�recursive_unicode)�unicode_type)�List�Tuple�Union�Dict�Anyzhello http://world.com/!z8hello <a href="http://world.com/">http://world.com/</a>!z0hello http://world.com/with?param=true&stuff=yeszqhello <a href="http://world.com/with?param=true&amp;stuff=yes">http://world.com/with?param=true&amp;stuff=yes</a>z>http://url.com/w(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz]<a href="http://url.com/w">http://url.com/w</a>(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz>http://url.com/withmany.......................................zd<a href="http://url.com/withmany">http://url.com/withmany</a>.......................................z;http://url.com/withmany((((((((((((((((((((((((((((((((((a)za<a href="http://url.com/withmany">http://url.com/withmany</a>((((((((((((((((((((((((((((((((((a)zhttp://foo.com/blah_blahz?<a href="http://foo.com/blah_blah">http://foo.com/blah_blah</a>zhttp://foo.com/blah_blah/zA<a href="http://foo.com/blah_blah/">http://foo.com/blah_blah/</a>z)(Something like http://foo.com/blah_blah)zP(Something like <a href="http://foo.com/blah_blah">http://foo.com/blah_blah</a>)z$http://foo.com/blah_blah_(wikipedia)zW<a href="http://foo.com/blah_blah_(wikipedia)">http://foo.com/blah_blah_(wikipedia)</a>z+http://foo.com/blah_(blah)_(wikipedia)_blahze<a href="http://foo.com/blah_(blah)_(wikipedia)_blah">http://foo.com/blah_(blah)_(wikipedia)_blah</a>z5(Something like http://foo.com/blah_blah_(wikipedia))zh(Something like <a href="http://foo.com/blah_blah_(wikipedia)">http://foo.com/blah_blah_(wikipedia)</a>)zhttp://foo.com/blah_blah.z@<a href="http://foo.com/blah_blah">http://foo.com/blah_blah</a>.zhttp://foo.com/blah_blah/.zB<a href="http://foo.com/blah_blah/">http://foo.com/blah_blah/</a>.z<http://foo.com/blah_blah>zG&lt;<a href="http://foo.com/blah_blah">http://foo.com/blah_blah</a>&gt;z<http://foo.com/blah_blah/>zI&lt;<a href="http://foo.com/blah_blah/">http://foo.com/blah_blah/</a>&gt;zhttp://foo.com/blah_blah,z@<a href="http://foo.com/blah_blah">http://foo.com/blah_blah</a>,z&http://www.example.com/wpstyle/?p=364.zZ<a href="http://www.example.com/wpstyle/?p=364">http://www.example.com/wpstyle/?p=364</a>.zrdar://1234�permitted_protocols�http�rdarz%<a href="rdar://1234">rdar://1234</a>z9rdar:/1234z#<a href="rdar:/1234">rdar:/1234</a>z'http://userid:password@example.com:8080z]<a href="http://userid:password@example.com:8080">http://userid:password@example.com:8080</a>zhttp://userid@example.comzA<a href="http://userid@example.com">http://userid@example.com</a>zhttp://userid@example.com:8080zK<a href="http://userid@example.com:8080">http://userid@example.com:8080</a>z"http://userid:password@example.comzS<a href="http://userid:password@example.com">http://userid:password@example.com</a>zFmessage://%3c330e7f8409726r6a4ba78dkf1fd71420c1bf6ff@mail.gmail.com%3e�messagez�<a href="message://%3c330e7f8409726r6a4ba78dkf1fd71420c1bf6ff@mail.gmail.com%3e">message://%3c330e7f8409726r6a4ba78dkf1fd71420c1bf6ff@mail.gmail.com%3e</a>uhttp://➡.ws/䨹u1<a href="http://➡.ws/䨹">http://➡.ws/䨹</a>z<tag>http://example.com</tag>zJ&lt;tag&gt;<a href="http://example.com">http://example.com</a>&lt;/tag&gt;zJust a www.example.com link.zAJust a <a href="http://www.example.com">www.example.com</a> link.�require_protocolTz:A http://reallylong.com/link/that/exceedsthelenglimit.html)r�shortenz�A <a href="http://reallylong.com/link/that/exceedsthelenglimit.html" title="http://reallylong.com/link/that/exceedsthelenglimit.html">http://reallylong.com/link...</a>z6A http://reallylongdomainnamethatwillbetoolong.com/hi!rz�A <a href="http://reallylongdomainnamethatwillbetoolong.com/hi" title="http://reallylongdomainnamethatwillbetoolong.com/hi">http://reallylongdomainnametha...</a>!z/A file:///passwords.txt and http://web.com linkzLA file:///passwords.txt and <a href="http://web.com">http://web.com</a> link�filezSA <a href="file:///passwords.txt">file:///passwords.txt</a> and http://web.com linkzwww.external-link.com�extra_params�rel="nofollow" class="external"z`<a href="http://www.external-link.com" rel="nofollow" class="external">www.external-link.com</a>z;www.external-link.com and www.internal-link.com/blogs extrac�6�URS5(aS$S$)Nzhttp://www.internal-link.comzclass="internal"r)�10startswith��hrefs �^D:\code\apps\devtools\python\user_packages\Python313\site-packages\tornado/test/escape_test.py�<lambda>r!�s$���?�?�#A�B�B�#�7�6�7�z�<a href="http://www.external-link.com" rel="nofollow" class="external">www.external-link.com</a> and <a href="http://www.internal-link.com/blogs" class="internal">www.internal-link.com/blogs</a> extrac��g)Nz%    rel="nofollow" class="external"  �rs r r!r!�s��&Mr"c�V�\rSrSrSrSrSrSrSrSr	Sr11S	rS12rSr
SrS
rg)�EscapeTestCase��c��[H8upn[RR"U40UD6nUR	XC5 M: g)N)�
linkify_tests�tornado�escape�linkify�assertEqual)�self�text�kwargs�html�linkeds     r �test_linkify�EscapeTestCase.test_linkify�s8��"/��D�$��^�^�+�+�D�;�F�;�F����V�*�#0r"c	���/SQnUH_up#UR[[U55[U55 UR[U5[[U555 Ma g)N)�z<foo>z&lt;foo&gt;r6)s<foo>s&lt;foo&gt;)z<>&"'z&lt;&gt;&amp;&quot;&#x27;)z&amp;z	&amp;amp;)u<é>u13&lt;é&gt;)s<é>s14&lt;é&gt;)r-rrr�r.�tests�	unescaped�escapeds    r �test_xhtml_escape� EscapeTestCase.test_xhtml_escape�sT��15��#(��I����T�,�y�"9�:�D��M�J����T�)�_�d�>�'�3J�.K�L�#(r"c�X�/SQnUH up#URU[U55 M" g)N))zfoo&#32;bar�foo bar)zfoo&#x20;barr>)zfoo&#X20;barr>)z
foo&#xabc;baru	foo઼bar)�foo&#xyz;barr?)�	foo&#;barr@)�16foo&#x;barrA)r-r)r.r8r:r9s    r �test_xhtml_unescape_numeric�*EscapeTestCase.test_xhtml_unescape_numeric�s-��17��#(��G����Y��w�(?�@�#(r"c��SR5S4SRS5S4S/nUH up#UR[U5U5 M" g)N�é�%C3%A9�latin1z%E9)rErF)�encoder-rr7s    r �test_url_escape_unicode�&EscapeTestCase.test_url_escape_unicode�sR���_�_�
��)�
�_�_�X�
&��.� �18��#(��I����Z�	�2�G�<�#(r"c���SSS[S5S4/nUHPup#nUR[[U5U5U5 UR[[U5U5U5 MR g)N)rFrEr)rFuérGrFrE)rr-rr)r.r8r:r9�encodings     r �test_url_unescape_unicode�(EscapeTestCase.test_url_unescape_unicodesg��(�0�
�t�H�~�t�,�19��20-2�(�G��
���\�*�W�*=�x�H�)�T����\�$�w�-��B�I�N�-2r"c�r�SnSnSnUR[U5U5 UR[USS9U5 UR[U5U5 UR[USS9U5 UR[USS9[U55 UR[USSS9[U55 g)Nz+ #%z21%2B+%23%25z%2B%20%23%25F)�plus)rL)rLrP)r-rrr)r.r9�plus_escapedr:s    r �test_url_escape_quote_plus�)EscapeTestCase.test_url_escape_quote_pluss����	�#�� ������I�.��=�����I�E�:�G�D�����l�3�Y�?�����g�E�:�I�F�����l�T�B�D��O�T������4�e�<�d�9�o�	22r"c��UR[[S55[5 UR[[S55[5 g)N�foo)r-�typer�strr
�r.s r �test_escape_return_types�'EscapeTestCase.test_escape_return_typess8��	
����l�5�1�2�C�8�����l�5�1�2�L�Ar"c��UR[S5S5 UR[S5S5 UR[[S55S5 g)Ns"foo"rUz"foo"u"é"rE)r-r	rrXs r �test_json_decode�EscapeTestCase.test_json_decode"sJ��	
����X�.��6�����W�-�u�5�	
����T�*�%5�6��Ar"c	���UR[[S55S5 [[LaIUR[[[S555S5 UR
[[S5 gg)NrE��)r-r	r23�bytesrWr�assertRaises�UnicodeDecodeErrorrXs r �test_json_encode�EscapeTestCase.test_json_encode+s[��	
����[��%:�;�X�F��C�<����[��T�(�^�)D�E�x�P����0�+�w�G�r"c�:�UR[S5S5 g)Nz&sequences     of    whitespace   charszsequences of whitespace chars)r-rrXs r �test_squeeze�EscapeTestCase.test_squeeze4s������<�=�+�	24r"c��SS0SS/SSS.nUR[US5SS05 UR[US5SS/5 UR[US	5S255 UR[US5S5 g)N�foo�bar)rirj)�dict�list�tupler`rkrU�barrlrm)rUrnr`)r-r)r.r8s  r �test_recursive_unicode�%EscapeTestCase.test_recursive_unicode:s����V�$��V�$�%��	26��	
���*�5��=�9�E�5�>�J����*�5��=�9�E�5�>�J����*�5��>�:�N�K����*�5��>�:�E�Br"r$N)�__name__�27__module__�__qualname__�__firstlineno__r3r;rBrIrMrRrYr\rcrfro�__static_attributes__r$r"r r&r&�s@��+�28M�A�	=�O�29�B�B�H�30�31Cr"r&)�unittestr*�tornado.escaperrrrrrr	r32rr�tornado.utilr
�typingrrrrrr)�TestCaser&r$r"r �<module>r{s��������&�0�0��	#�33�B���	;�34�{���	I�35�g���(	I�36�n��'�2	F�37�k��1�@	#�38�I��?�J	$�39�K��I�T	4�40�Z��S�^	/�41�a��]�h	6�42�o��g�r	@�43�r��q�|	$�44�J��{�F	%�45�L��E�P	%�46�Q��O�Z	&�47�S��Y�d	$�48�J��c�n	1�49�d��m�x	�	��� 0�1�/��w�B	�	���)�-��A�L	2�50�g��K�V	$�51�K��U�`	)�52�U��_�j	-�53�]��i�t	Q�	��� 3�4�	U��s�@	"�54�G���J	(�55�T��I�T	'�56�K��S�^	'�	�T�"�&��]�h	E�!�d�3�	n��g�t	A�	�D��	n��s�@	:�57�V���J	:�	���)�]��I�T	 �	�:�;�j��S�^	F���	58�	s��]�v	 �	�M�N�j��u�
�DnC�X�&�&�nCr"
codekingpro/portable-devtools · Team Ai