403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.216.147
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/bs4/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/bs4/tests/__pycache__/test_dammit.cpython-311.pyc
�

���c[<���ddlZddlZddlZddlmZddlmZmZmZGd�de��Z	Gd�de��Z
Gd�d	e��ZdS)
�N)�
BeautifulSoup)�EntitySubstitution�EncodingDetector�
UnicodeDammitc��eZdZdZd�Zej�dgd���d���Zd�Z	d�Z
d�Zd	�Zd
�Z
d�ZdS)
�TestUnicodeDammitz"Standalone tests of UnicodeDammit.c�B�d}t|��}|j|ksJ�dS)NuI'm already Unicode! ☃)r�unicode_markup)�self�markup�dammits   �7/usr/lib/python3/dist-packages/bs4/tests/test_dammit.py�test_unicode_inputz$TestUnicodeDammit.test_unicode_inputs.��3���v�&�&���$��.�.�.�.�.�.�z smart_quotes_to,expect_converted))Nu‘’“”)�xmlz &#x2018;&#x2019;&#x201C;&#x201D;)�htmlz&lsquo;&rsquo;&ldquo;&rdquo;)�asciiz''""c�p�d}t|dg|���j}|d�|��ksJ�dS)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_tosX��0��!��n�-=�+�
�
�
��	��O�2�2�3C�D�D�D�D�D�D�D�Drc��d}t|��}|j���dksJ�|jdksJ�dS)NsSacré bleu! ☃�utf-8uSacré bleu! ☃�r�original_encoding�lowerr
)r�utf8r
s   r�test_detect_utf8z"TestUnicodeDammit.test_detect_utf8&sO��1���t�$�$���'�-�-�/�/�7�:�:�:�:��$�(D�D�D�D�D�D�Drc��d}t|dg��}|j���dksJ�|jdksJ�dS)N����
iso-8859-8uםולשr�r�hebrewr
s   r�test_convert_hebrewz%TestUnicodeDammit.test_convert_hebrew,sS��$���v��~�6�6���'�-�-�/�/�<�?�?�?�?��$�(B�B�B�B�B�B�Brc��d}t|��}|j���dksJ�|j�d��|ksJ�dS)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_none2s\��I���u�%�%���'�-�-�/�/�7�:�:�:�:��$�+�+�G�4�4��=�=�=�=�=�=rc��d�d��}t|dg��}|j���dksJ�dS)N�
Räksmörgåsrr%�r*rrr �r�	utf8_datar
s   r� test_ignore_inappropriate_codecsz2TestUnicodeDammit.test_ignore_inappropriate_codecs8sL��#�*�*�7�3�3�	��y�<�.�9�9���'�-�-�/�/�7�:�:�:�:�:�:rc��d�d��}dD]2}t||g��}|j���dksJ��3dS)Nr.r)z.utf8z...z
utF---16.!r/)rr1�bad_encodingr
s    r�test_ignore_invalid_codecsz,TestUnicodeDammit.test_ignore_invalid_codecs=sb��#�*�*�7�3�3�	�:�	?�	?�L�"�9�|�n�=�=�F��+�1�1�3�3�w�>�>�>�>�>�	?�	?rc���d�d��}t|dg���}|j���dksJ�t|ddg���}|jdksJ�dS)Nr.r)�exclude_encodingsrr/r0s   r�test_exclude_encodingsz(TestUnicodeDammit.test_exclude_encodingsCs���#�*�*�7�3�3�	��y�W�I�F�F�F���'�-�-�/�/�>�A�A�A�A���'�>�)B�D�D�D���'�4�/�/�/�/�/�/rN)�__name__�
__module__�__qualname__�__doc__r�pytest�mark�parametrizerr"r(r,r2r5r8�rrrrs�������,�,�/�/�/�
�[���*�	
�	
�	
���E�E���E�E�E�E�C�C�C�>�>�>�;�;�;�
?�?�?�0�0�0�0�0rrc�D�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
S)�TestEncodingDetectorc�X�td��}t|j��}d|vsJ�dS)Ns'<?xml version="1.0" encoding="UTF-�" ?>uutf-�)r�list�	encodings)r�detectedrEs   r�Ptest_encoding_detector_replaces_junk_in_encoding_name_with_replacement_characterzeTestEncodingDetector.test_encoding_detector_replaces_junk_in_encoding_name_with_replacement_characterSs;��#�9�;�;����+�,�,�	�.�)�;�;�;�;�;�;rc�L�dD] }t|d���}d|jksJ��!dS)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_tagYsH��4�	8�	8�D�
#�4��6�6�6�F��v�7�7�7�7�7�7�
	8�	8rc���d}tjj}tjtj��	d�}|tj_t
|��}d|jksJ�d|jvsJ�t|d��}|jsJ�	tjtj
��|tj_dS#tjtj
��|tj_wxYw)NsT<?xml version="1.0" encoding="UTF-8"?>
<html><b>بتر</b>
<i>��ѐ����</i></html>c��dS�Nr@)�strs r�noopzETestEncodingDetector.test_last_ditch_entity_replacement.<locals>.noopys���trTu�zhtml.parser)�bs4r
�chardet_dammit�logging�disable�WARNINGr�contains_replacement_charactersr
r�NOTSET)r�doc�chardetrRr
�soups      r�"test_last_ditch_entity_replacementz7TestEncodingDetector.test_last_ditch_entity_replacementcs��� 2���*�+������(�(�(�	0�
�
�
�(,�C�J�%�"�3�'�'�F��6�A�A�A�A�A��v�4�4�4�4�4� ��m�4�4�D��7�7�7�7�7��O�G�N�+�+�+�(/�C�J�%�%�%��
�O�G�N�+�+�+�(/�C�J�%�/�/�/�/s�AB9�91C*c�\�d}t|��}d|jksJ�d|jksJ�dS)N���<a>��</a>u<a>áé</a>�utf-16le)rr
rrKs   r�test_byte_order_mark_removedz1TestEncodingDetector.test_byte_order_mark_removed�sB��M���t�$�$���� 5�5�5�5�5��V�5�5�5�5�5�5�5rc�L�d}t|��}t|dg���}d|jksJ�t|dg���}d|jksJ�dgd�|jD��ksJ�d}t|dgd	g�
��}d	|jksJ�dd	gd�|jD��ksJ�dS)Nr_zutf-16)rr)�user_encodingsr`c��g|]
}|d��S�rr@��.0�xs  r�
<listcomp>zRTestEncodingDetector.test_known_definite_versus_user_encodings.<locals>.<listcomp>�s��E�E�E���!��E�E�Err$r%)rrcc��g|]
}|d��Srer@rfs  rrizRTestEncodingDetector.test_known_definite_versus_user_encodings.<locals>.<listcomp>�s��*P�*P�*P�A�1�Q�4�*P�*P�*Pr�rr�tried_encodings)rrLr
�before�afterr's      r�)test_known_definite_versus_user_encodingsz>TestEncodingDetector.test_known_definite_versus_user_encodings�s���
N���t�$�$���t�x�j�I�I�I���6�3�3�3�3�3�
�d�G�9�=�=�=���U�4�4�4�4�4��|�E�E�f�.D�E�E�E�E�E�E�E�%���v��	�/;�n�>�>�>���v�7�7�7�7�7���&�*P�*P��9O�*P�*P�*P�P�P�P�P�P�Prc��d}t|dgdgdg���}d|jksJ�gd�d�|jD��ksJ�dS)Nr$�	shift-jisrr%)r�override_encodingsrc)rqrr%c��g|]
}|d��Srer@rfs  rrizKTestEncodingDetector.test_deprecated_override_encodings.<locals>.<listcomp>�s��2�2�2�a�Q�q�T�2�2�2rrkr&s   r�"test_deprecated_override_encodingsz7TestEncodingDetector.test_deprecated_override_encodings�s���%����&1�]� '�y�(�>�	
�
�
���v�7�7�7�7�7�4�3�3�2�2�6�1�2�2�2�
�
�
�
�
�
rc�T�d�d��}d�d��}||z|z}tjt��5|�d��ddd��n#1swxYwYtj|��}d|�d��ksJ�dS)Nu	☃☃☃r!u“Hi, I like Windows!”�windows_1252u+☃☃☃“Hi, I like Windows!”☃☃☃)r*r=�raises�UnicodeDecodeError�decoder�	detwingle)rr!rvrZ�fixeds     r�test_detwinglez#TestEncodingDetector.test_detwingle�s���!�)�)�&�1�1��
.�/5�v�n�/E�/E�	�
�\�!�D�(���]�-�
.�
.�	�	��J�J�v����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��'��,�,��<����V�@T�@T�T�T�T�T�T�Ts�A.�.A2�5A2c��dD]J}|�d��}|�d��sJ�tj|��}||ksJ��KdS)N)uœuₓu𐐓r!��)r*�endswithrrz)r�tricky_unicode_char�input�outputs    r�+test_detwingle_ignores_multibyte_charactersz@TestEncodingDetector.test_detwingle_ignores_multibyte_characters�sj��
$�	#�	#��
(�.�.�v�6�6�E��>�>�'�*�*�*�*�*�"�,�U�3�3�F��U�?�?�?�?�?�	#�	#rc��d}|�d��}d}|�d��}tj}||d����J�d||d���ksJ�d||d���ksJ�d||��ksJ�d||��ksJ�d	d
z}|||z���J�|||z���J�|||zdd���dksJ�||d���dksJ�|d	|zd���dksJ�|d
|zd����J�dS)Nz0<html><head><meta charset="utf-8"></head></html>rz,<?xml version="1.0" encoding="ISO-8859-1" ?>FrIrTz
iso-8859-1� i�)rJ�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�1�
�C���&�&�w�/�/�	��3���q��u�-�-�-�5�5�5��!�!�L�$�7�7�7�7�7�7�7��!�!�J��5�5�5�5�5�5�5��q�q��~�~�-�-�-�-��q�q��|�|�+�+�+�+������q��*�$�%�%�-�-�-��q��)�#�$�$�,�,�,�

�A�f�z�!�4��M�M�M��
�
�
�
��q��4�8�8�8�L�H�H�H�H��q��	�!�$�?�?�?�<�O�O�O�O��q��	�!�$�?�?�?�G�G�G�G�GrN)r9r:r;rGrMr]rarortr|r�r�r@rrrBrBQs�������<�<�<�8�8�8�!0�!0�!0�F6�6�6�Q�Q�Q�>
�
�
�$U�U�U�.
#�
#�
#�(H�(H�(H�(H�(HrrBc��eZdZdZd�Zej�dddg��d���Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�ZdS)�TestEntitySubstitutionz1Standalone tests of the EntitySubstitution class.c��t|_dSrP)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�F�|j�|��|ksJ�dSrP�r��substitute_html)r�original�substituteds   r�test_substitute_htmlz+TestEntitySubstitution.test_substitute_htmls+���x�'�'��1�1�[�@�@�@�@�@�@rc�n�dD]1\}}d}||z}||z}|j�|��|ksJ��2dS)N)
)z&models;u⊧)z&Nfr;u𝔑)z&ngeqq;u≧̸)z&not;�¬)z&Not;u⫬z||)�fjr�)z&gt;�>)z&lt;�<)z&amp;�&z3 %s 4r�)r�entity�u�template�raw�
with_entitiess      r�test_html5_entityz(TestEntitySubstitution.test_html5_entity%sc��
�	B�	B�I�F�A�0 �H��Q�,�C�$�v�-�M��8�+�+�C�0�0�M�A�A�A�A�A�7	B�	Brc��d}d}|j�|��|ksJ�d}d}|j�|��|ksJ�dS)Nufjords ⊔ penguinszfjords &sqcup; penguinsufjords ⊔︀ penguinszfjords &sqcups; penguinsr�)rrLrs   r�)test_html5_entity_with_variation_selectorz@TestEntitySubstitution.test_html5_entity_with_variation_selectorCs`��(��*���x�'�'��-�-��7�7�7�7�-��+���x�'�'��-�-��7�7�7�7�7�7rc�L�d}|j�|d��|ksJ�dS)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_falseOs0��!���x�&�&�q�%�0�0�A�5�5�5�5�5�5rc��|j�dd��dksJ�|j�dd��dksJ�dS)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_quotesSsN���x�&�&�y�$�7�7�;�F�F�F�F��x�&�&�{�D�9�9�^�K�K�K�K�K�Krc�L�d}|j�|d��dksJ�dS)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_quotesWs1��!���x�&�&�q�$�/�/�3L�L�L�L�L�L�Lrc�L�d}|j�|d��dksJ�dS)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_quotes[s1��%���x�&�&�q�$�/�/�3X�X�X�X�X�X�Xrc�J�d}|j�|��|ksJ�dS)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_quoted_s.��*���x�&�&�v�.�.�&�8�8�8�8�8�8rc�F�|j�d��dksJ�dS)Nzfoo<bar>zfoo&lt;bar&gt;r�r�s r�'test_xml_quoting_handles_angle_bracketsz>TestEntitySubstitution.test_xml_quoting_handles_angle_bracketscs*���x�&�&�z�2�2�6F�F�F�F�F�F�Frc�F�|j�d��dksJ�dS)NzAT&TzAT&amp;Tr�r�s r�#test_xml_quoting_handles_ampersandsz:TestEntitySubstitution.test_xml_quoting_handles_ampersandsfs)���x�&�&�v�.�.�*�<�<�<�<�<�<rc�F�|j�d��dksJ�dS)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_entityis*���x�&�&�}�5�5�9N�N�N�N�N�N�Nrc�F�|j�d��dksJ�dS)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_entityls*���x�:�:�=�I�I�M^�^�^�^�^�^�^rc�J�d}|j�|��|ksJ�dS)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_substitutedos.�����x�'�'��-�-��5�5�5�5�5�5rN)r9r:r;r<r�r=r>r?r�r�r�r�r�r�r�r�r�r�r�r�r�r@rrr�r�s8������;�;�&�&�&��[����
2�

C�		
���A�A���A�B�B�B�<
8�
8�
8�6�6�6�L�L�L�M�M�M�Y�Y�Y�9�9�9�G�G�G�=�=�=�O�O�O�_�_�_�6�6�6�6�6rr�)r=rUrSr�
bs4.dammitrrr�objectrrBr�r@rr�<module>r�s��
�
�
�
�����
�
�
�
�����������������C0�C0�C0�C0�C0��C0�C0�C0�J{H�{H�{H�{H�{H�6�{H�{H�{H�|c6�c6�c6�c6�c6�V�c6�c6�c6�c6�c6r

Youez - 2016 - github.com/yon3zu
LinuXploit