403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Python312/Lib/site-packages/bs4/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Python312/Lib/site-packages/bs4/tests/__pycache__/test_dammit.cpython-312.pyc
�

V	�g�E���ddlZddlZddlZddlZddlmZddlmZmZmZGd�de	�Z
Gd�de	�ZGd�d	e	�Zy)
�N)�
BeautifulSoup)�EntitySubstitution�EncodingDetector�
UnicodeDammitc��eZdZdZd�Zejjdgd��d��Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zy)
�TestUnicodeDammitz"Standalone tests of UnicodeDammit.c�@�d}t|�}|j|k(sJ�y)NuI'm already Unicode! ☃)r�unicode_markup)�self�markup�dammits   �7C:\Python312\Lib\site-packages\bs4/tests/test_dammit.py�test_unicode_inputz$TestUnicodeDammit.test_unicode_inputs%��3���v�&���$�$��.�.�.�z smart_quotes_to,expect_converted))Nu‘’“”)�xmlz ‘’“”)�htmlz‘’“”)�asciiz''""c�f�d}t|dg|��j}|dj|�k(sJ�y)zbVerify the functionality of the smart_quotes_to argument
        to the UnicodeDammit constructor.s<foo>����</foo>�windows-1252)�known_definite_encodings�smart_quotes_toz
<foo>{}</foo>N)rr
�format)rr�expect_convertedr�	converteds     r�test_smart_quotes_toz&TestUnicodeDammit.test_smart_quotes_tosE��0��!��&4�%5�+�
��.�		�
�O�2�2�3C�D�D�D�Drc�~�d}t|�}|jj�dk(sJ�|jdk(sJ�y)NsSacré bleu! ☃�utf-8uSacré bleu! ☃�r�original_encoding�lowerr
)r�utf8r
s   r�test_detect_utf8z"TestUnicodeDammit.test_detect_utf8*sC��1���t�$���'�'�-�-�/�7�:�:�:��$�$�(D�D�D�Drc��d}t|dg�}|jj�dk(sJ�|jdk(sJ�y)N����
iso-8859-8uםולשr)r�hebrewr
s   r�test_convert_hebrewz%TestUnicodeDammit.test_convert_hebrew0sG��$���v��~�6���'�'�-�-�/�<�?�?�?��$�$�(B�B�B�Brc��d}t|�}|jj�dk(sJ�|jj	d�|k(sJ�y)Nsケータイ Watchr)rrr r
�encode)r�utf_8r
s   r�/test_dont_see_smart_quotes_where_there_are_nonezATestUnicodeDammit.test_dont_see_smart_quotes_where_there_are_none6sM��I���u�%���'�'�-�-�/�7�:�:�:��$�$�+�+�G�4��=�=�=rc�~�djd�}t|dg�}|jj�dk(sJ�y)N�
Räksmörgåsrr%�r)rrr �r�	utf8_datar
s   r� test_ignore_inappropriate_codecsz2TestUnicodeDammit.test_ignore_inappropriate_codecs<s=��#�*�*�7�3�	��y�<�.�9���'�'�-�-�/�7�:�:�:rc��djd�}dD].}t||g�}|jj�dk(r�.J�y)Nr-r)z.utf8z...z
utF---16.!r.)rr0�bad_encodingr
s    r�test_ignore_invalid_codecsz,TestUnicodeDammit.test_ignore_invalid_codecsAsL��#�*�*�7�3�	�:�	?�L�"�9�|�n�=�F��+�+�1�1�3�w�>�>�>�	?rc��djd�}t|dg��}|jj�dk(sJ�t|ddg��}|j�J�y)Nr-r)�exclude_encodingsrr.r/s   r�test_exclude_encodingsz(TestUnicodeDammit.test_exclude_encodingsGsd��#�*�*�7�3�	��y�W�I�F���'�'�-�-�/�>�A�A�A��y�W�n�<U�V���'�'�/�/�/rN)�__name__�
__module__�__qualname__�__doc__r�pytest�mark�parametrizerr"r'r+r1r4r7�rrrrsW��,�/�
�[�[���*�	
��	E��	E�E�C�>�;�
?�0rrc�B�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�TestEncodingDetectorc�P�td�}t|j�}d|vsJ�y)Ns'<?xml version="1.0" encoding="UTF-�" ?>uutf-�)r�list�	encodings)r�detectedrDs   r�Ptest_encoding_detector_replaces_junk_in_encoding_name_with_replacement_characterzeTestEncodingDetector.test_encoding_detector_replaces_junk_in_encoding_name_with_replacement_characterVs-��$�$Q�R����+�+�,�	�.�)�;�;�;rc�N�dD] }t|d��}d|jk(r� J�y)N)s&<html><meta charset="euc-jp" /></html>s&<html><meta charset='euc-jp' /></html>s$<html><meta charset=euc-jp /></html>s#<html><meta charset=euc-jp/></html>T��is_htmlzeuc-jp)rr�r�datar
s   r� test_detect_html5_style_meta_tagz5TestEncodingDetector.test_detect_html5_style_meta_tag]s5��
�	8�D�#�4��6�F��v�7�7�7�7�7�	8rc�*�d}tjj}tjtj
�	d�}|tj_t
|�}d|jusJ�d|jvsJ�t|d�}|jsJ�	tjtj�|tj_y#tjtj�|tj_wxYw)NsT<?xml version="1.0" encoding="UTF-8"?>
<html><b>بتر</b>
<i>��ѐ����</i></html>c��y�Nr?)�strs r�noopzETestEncodingDetector.test_last_ditch_entity_replacement.<locals>.noop~s��rTu�zhtml.parser)�bs4r
�_chardet_dammit�logging�disable�WARNINGr�contains_replacement_charactersr
r�NOTSET)r�doc�chardetrQr
�soups      r�"test_last_ditch_entity_replacementz7TestEncodingDetector.test_last_ditch_entity_replacementgs��� 2���*�*�,�,��������(�	1�
�*.�C�J�J�&�"�3�'�F��6�A�A�A�A�A��v�4�4�4�4�4� ��m�4�D��7�7�7�7��O�O�G�N�N�+�)0�C�J�J�&��
�O�O�G�N�N�+�)0�C�J�J�&�s
�AC�:Dc�b�d}t|�}d|jk(sJ�d|jk(sJ�y)N���<a>��</a>u<a>áé</a>�utf-16le)rr
rrJs   r�test_byte_order_mark_removedz1TestEncodingDetector.test_byte_order_mark_removed�s9��M���t�$���� 5� 5�5�5�5��V�5�5�5�5�5rc��d}t|�}t|dg��}d|jk(sJ�t|dg��}d|jk(sJ�dg|jD�cgc]}|d��	c}k(sJ�d}t|dgd	g�
�}d	|jk(sJ�dd	g|jD�cgc]}|d��	c}k(sJ�ycc}wcc}w)Nr^zutf-16)rr)�user_encodingsr_rr$r%)rrb)rr�tried_encodings)rrKr
�before�after�xr&s       r�)test_known_definite_versus_user_encodingsz>TestEncodingDetector.test_known_definite_versus_user_encodings�s���
N���t�$���t�x�j�I���6�3�3�3�3�3�
�d�G�9�=���U�4�4�4�4�4��|�f�.D�.D�E���!��E�E�E�E�%����g�Y��~�
���v�7�7�7�7�7���&��9O�9O�*P�A�1�Q�4�*P�P�P�P�� F��+Qs�B7�#B<c�d�d}tjd��5}t|dgdgdg��}ddd�\}|j}t	|t
�sJ�|jtk(sJ�djk(sJ�gd�|jD�cgc]}|d	��	c}k(sJ�y#1swY�vxYwcc}w)
Nr$T)�record�	shift-jisrr%)r�override_encodingsrb)rjrr%r)
�warnings�catch_warningsr�message�
isinstance�DeprecationWarning�filename�__file__rrc)rr&�wr
�warningrnrfs       r�"test_deprecated_override_encodingsz7TestEncodingDetector.test_deprecated_override_encodings�s���%��
�
$�
$�D�
1�	�Q�"��*5��$+�9� ,�~�	�F�	��	���/�/���'�#5�6�6�6����8�+�+�+��v�7�7�7�7�7�4�!�1�1�2�a�Q�q�T�2�
�	
�
�	�	�� 
3s�B!�
B-�!B*c�,�djd�}djd�}||z|z}tjt�5|j	d�ddd�tj|�}d|j	d�k(sJ�y#1swY�5xYw)Nu	☃☃☃r!u“Hi, I like Windows!”�windows_1252u+☃☃☃“Hi, I like Windows!”☃☃☃)r)r<�raises�UnicodeDecodeError�decoder�	detwingle)rr!rwrY�fixeds     r�test_detwinglez#TestEncodingDetector.test_detwingle�s���!�)�)�&�1��
.�
�&��
 �	��\�!�D�(���]�]�-�
.�	��J�J�v��	��'�'��,��<����V�@T�T�T�T�	�	�s�B
�
Bc��dD]B}|jd�}|jd�sJ�tj|�}||k(r�BJ�y)N)uœuₓu𐐓r!��)r)�endswithrr{)r�tricky_unicode_char�input�outputs    r�+test_detwingle_ignores_multibyte_charactersz@TestEncodingDetector.test_detwingle_ignores_multibyte_characters�sT��
$
�	#��
(�.�.�v�6�E��>�>�'�*�*�*�"�,�,�U�3�F��U�?�"�?�	#rc��d}|jd�}d}|jd�}tj}||d���J�d||d��k(sJ�d||d��k(sJ�d||�k(sJ�d||�k(sJ�d	d
z}|||z��J�|||z��J�|||zdd��dk(sJ�||d��dk(sJ�|d	|zd��dk(sJ�|d
|zd���J�y)Nz0<html><head><meta charset="utf-8"></head></html>rz,<?xml version="1.0" encoding="ISO-8859-1" ?>FrHrTz
iso-8859-1� i�)rI�search_entire_document)r��a)r)r�find_declared_encoding)r�html_unicode�
html_bytes�xml_unicode�	xml_bytes�m�spacers       r�test_find_declared_encodingz0TestEncodingDetector.test_find_declared_encoding�s<��J��!�(�(��1�
�D���&�&�w�/�	��3�3����u�-�5�5�5��!�L�$�7�7�7�7��!�J��5�5�5�5��q��~�-�-�-��q��|�+�+�+�������*�$�%�-�-�-���)�#�$�,�,�,�

�f�z�!�4��M�QX�X�	
�X���4�8�L�H�H�H���	�!�$�?�<�O�O�O���	�!�$�?�G�G�GrN)r8r9r:rFrLr\r`rgrur}r�r�r?rrrArAUs4��<�8�#1�J6�Q�@
�.U�0
#�'HrrAc�|�eZdZdZd�Zejjdddg�d��Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zejjdgd��d��Zejjdgd��d��Zejjddg�d��Zy)�TestEntitySubstitutionz1Standalone tests of the EntitySubstitution class.c��t|_yrO)r�sub�rs r�setup_methodz#TestEntitySubstitution.setup_methods	��%��rzoriginal,substituted)ufoo∀☃õbarufoo&forall;☃&otilde;bar)u‘’foo“”z&lsquo;&rsquo;foo&ldquo;&rdquo;c�D�|jj|�|k(sJ�yrO�r��substitute_html)r�original�substituteds   r�test_substitute_htmlz+TestEntitySubstitution.test_substitute_html!s!���x�x�'�'��1�[�@�@�@rc�p�dD]1\}}d}||z}||z}|jj|�|k(r�1J�y)N)	)z&models;u⊧)z&Nfr;u𝔑)z&ngeqq;u≧̸)z&not;�¬)z&Not;u⫬z||)�fjr�)z&gt;�>)z&lt;�<z3 %s 4r�)r�entity�u�template�raw�
with_entitiess      r�test_html5_entityz(TestEntitySubstitution.test_html5_entity/sP��
�	B�I�F�A�( �H��Q�,�C�$�v�-�M��8�8�+�+�C�0�M�A�A�A�/	Brc��d}d}|jj|�|k(sJ�d}d}|jj|�|k(sJ�y)Nufjords ⊔ penguinszfjords &sqcup; penguinsufjords ⊔︀ penguinszfjords &sqcups; penguinsr�)rrKrs   r�)test_html5_entity_with_variation_selectorz@TestEntitySubstitution.test_html5_entity_with_variation_selectorIsR��(��*���x�x�'�'��-��7�7�7�-��+���x�x�'�'��-��7�7�7rc�J�d}|jj|d�|k(sJ�y)N�Welcome to "my bar"F�r��substitute_xml�r�ss  r�Itest_xml_converstion_includes_no_quotes_if_make_quoted_attribute_is_falsez`TestEntitySubstitution.test_xml_converstion_includes_no_quotes_if_make_quoted_attribute_is_falseUs&��!���x�x�&�&�q�%�0�A�5�5�5rc��|jjdd�dk(sJ�|jjdd�dk(sJ�y)N�WelcomeTz	"Welcome"z	Bob's Barz"Bob's Bar"r�r�s r�6test_xml_attribute_quoting_normally_uses_double_quoteszMTestEntitySubstitution.test_xml_attribute_quoting_normally_uses_double_quotesYs@���x�x�&�&�y�$�7�;�F�F�F��x�x�&�&�{�D�9�^�K�K�Krc�J�d}|jj|d�dk(sJ�y)Nr�Tz'Welcome to "my bar"'r�r�s  r�Otest_xml_attribute_quoting_uses_single_quotes_when_value_contains_double_quoteszfTestEntitySubstitution.test_xml_attribute_quoting_uses_single_quotes_when_value_contains_double_quotes]s)��
"���x�x�&�&�q�$�/�3L�L�L�Lrc�J�d}|jj|d�dk(sJ�y)N�Welcome to "Bob's Bar"Tz""Welcome to &quot;Bob's Bar&quot;"r�r�s  r�btest_xml_attribute_quoting_escapes_single_quotes_when_value_contains_both_single_and_double_quoteszyTestEntitySubstitution.test_xml_attribute_quoting_escapes_single_quotes_when_value_contains_both_single_and_double_quotescs)��
&���x�x�&�&�q�$�/�3X�X�X�Xrc�H�d}|jj|�|k(sJ�y)Nr�r�)r�quoteds  r�<test_xml_quotes_arent_escaped_when_value_is_not_being_quotedzSTestEntitySubstitution.test_xml_quotes_arent_escaped_when_value_is_not_being_quotedis$��*���x�x�&�&�v�.�&�8�8�8rc�D�|jjd�dk(sJ�y)Nzfoo<bar>zfoo&lt;bar&gt;r�r�s r�'test_xml_quoting_handles_angle_bracketsz>TestEntitySubstitution.test_xml_quoting_handles_angle_bracketsms ���x�x�&�&�z�2�6F�F�F�Frc�D�|jjd�dk(sJ�y)NzAT&TzAT&amp;Tr�r�s r�#test_xml_quoting_handles_ampersandsz:TestEntitySubstitution.test_xml_quoting_handles_ampersandsps���x�x�&�&�v�.�*�<�<�<rc�D�|jjd�dk(sJ�y)N�&Aacute;T&Tz&amp;Aacute;T&amp;Tr�r�s r�Etest_xml_quoting_including_ampersands_when_they_are_part_of_an_entityz\TestEntitySubstitution.test_xml_quoting_including_ampersands_when_they_are_part_of_an_entityss ���x�x�&�&�}�5�9N�N�N�Nrc�D�|jjd�dk(sJ�y)Nr�z&Aacute;T&amp;T)r��"substitute_xml_containing_entitiesr�s r�Dtest_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entityz[TestEntitySubstitution.test_xml_quoting_ignoring_ampersands_when_they_are_part_of_an_entityvs&���H�H�7�7�
�F� �
!�	
�
!rc�H�d}|jj|�|k(sJ�y)z:There's no need to do this except inside attribute values.zBob's "bar"Nr�)r�texts  r� test_quotes_not_html_substitutedz7TestEntitySubstitution.test_quotes_not_html_substituted|s$�����x�x�'�'��-��5�5�5rzmarkup, old))z	foo & barz
foo &amp; bar)zfoo&zfoo&amp;)z
foo&&& barzfoo&amp;&amp;&amp; bar)zx=1&y=2zx=1&amp;y=2)z&123z&amp;123)z&abcz&amp;abc)z
foo &0 barzfoo &amp;0 bar)zfoo &lolwat barzfoo &amp;lolwat barc��|jj|�|k(sJ�|jj|�|k(sJ�yrO�r�r��substitute_html5_raw)rr�olds   r�'test_unambiguous_ampersands_not_escapedz>TestEntitySubstitution.test_unambiguous_ampersands_not_escaped�s>���x�x�'�'��/�3�6�6�6��x�x�,�,�V�4��>�>�>rzmarkup,html,html5,html5raw))�&divide;�&amp;divide;r�r�)z
&nonesuch;�&amp;nonesuch;r�r�)z&#247;�
&amp;#247;r�r�)z&#xa1;�
&amp;#xa1;r�r�c���|jj|�|k(sJ�|jj|�|k(sJ�|jj|�|k(sJ�yrO)r�r��substitute_html5r�)rrr�html5�html5raws     r�'test_when_entity_ampersands_are_escapedz>TestEntitySubstitution.test_when_entity_ampersands_are_escaped�s[��,�x�x�'�'��/�4�7�7�7��x�x�(�(��0�E�9�9�9��x�x�,�,�V�4��@�@�@rz
markup,expect)z&nosuchentity;z&amp;nosuchentity;c��|jj|�|k(sJ�|jj|�|k(sJ�yrOr�)rr�expects   r�!test_ambiguous_ampersands_escapedz8TestEntitySubstitution.test_ambiguous_ampersands_escaped�s>���x�x�'�'��/�6�9�9�9��x�x�,�,�V�4��>�>�>rN)r8r9r:r;r�r<r=r>r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r?rrr�r�s	��;�&��[�[����
S�
C�
	
�
�A�
�A�B�4
8�6�L�M�Y�9�G�=�O�
�6�
�[�[����		
��?��?��[�[���$�	
��A��A�"�[�[����B�C��?��?rr�)
r<rTrlrRr�
bs4.dammitrrr�objectrrAr�r?rr�<module>r�sL��
���
����D0��D0�NCH�6�CH�LV?�V�V?r

Youez - 2016 - github.com/yon3zu
LinuXploit