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_pageelement.cpython-312.pyc
�

V	�gC?���dZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZddl
mZGd�d	e�ZGd
�de�ZGd�d
e�ZGd�de�Zy)z*Tests of the bs4.element.PageElement class�N)�
BeautifulSoup)�AttributeValueList�Comment)�SoupStrainer�)�SoupTestc�F�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�TestEncodingz0Test the ability to encode objects into strings.c��d}|j|�}|jjjd�djd�k(sJ�y)N�
<b>☃</b>�utf-8�☃)�soup�b�string�encode��self�htmlrs   �<C:\Python312\Lib\site-packages\bs4/tests/test_pageelement.py�"test_unicode_string_can_be_encodedz/TestEncoding.test_unicode_string_can_be_encodeds@��#���y�y�����v�v�}�}�#�#�G�,�
�0D�0D�W�0M�M�M�M�c��d}|j|�}|jjd�|jd�k(sJ�y)Nrr
�rrrrs   r�1test_tag_containing_unicode_string_can_be_encodedz>TestEncoding.test_tag_containing_unicode_string_can_be_encodeds8��#���y�y�����v�v�}�}�W�%����W�)=�=�=�=rc�j�d}|j|�}|jjd�dk(sJ�y)Nr�asciis<b>&#9731;</b>rrs   r�<test_encoding_substitutes_unrecognized_characters_by_defaultzITestEncoding.test_encoding_substitutes_unrecognized_characters_by_default!s0��#���y�y�����v�v�}�}�W�%�):�:�:�:rc��d}|j|�}tjt�5|j	dd��ddd�y#1swYyxYw)Nrr�strict)�errors)r�pytest�raises�UnicodeEncodeErrorrrs   r� test_encoding_can_be_made_strictz-TestEncoding.test_encoding_can_be_made_strict&sF��#���y�y����
�]�]�-�
.�	2��K�K���K�1�	2�	2�	2�s�A
�
Ac�h�d}|j|�}d|jj�k(sJ�y)Nrr)rr�decode_contentsrs   r�test_decode_contentsz!TestEncoding.test_decode_contents,s/��#���y�y�������� 6� 6� 8�8�8�8rc��d}|j|�}djd�|jjd��k(sJ�y)Nrr�utf8)�encoding)rrr�encode_contentsrs   r�test_encode_contentsz!TestEncoding.test_encode_contents1s?��#���y�y�����#�#�F�+�t�v�v�/E�/E�v�/E�/V�V�V�Vrc��tj�dz}d|z}|j|�}|j�}||j	d�k(sJ�y)Nr�<span>s<span>)�sys�getrecursionlimitrr�count)r�limit�markupr�encodeds     r�"test_encode_deeply_nested_documentz/TestEncoding.test_encode_deeply_nested_document6sQ���%�%�'�!�+���E�!���y�y�� ���+�+�-����
�
�i�0�0�0�0rc�t�d}|j|�}tjd��5}|j�dj	d�|j
j�k(sJ�	ddd�D�cgc]}t
|j���}}td�|D��sJ�y#1swY�@xYwcc}w)NrT)�recordrr*c3�&K�|]	}|dk(���y�w)zjCall to deprecated method renderContents. (Replaced by encode_contents) -- Deprecated since version 4.0.0.N�)�.0�xs  r�	<genexpr>z>TestEncoding.test_deprecated_renderContents.<locals>.<genexpr>Gs#����
��
�{�
|�
�s�)	r�warnings�catch_warnings�renderContentsrr�str�message�all)rrr�w�warning�msgss      r�test_deprecated_renderContentsz+TestEncoding.test_deprecated_renderContents@s���#���y�y����
�
$�
$�D�
1�	K�Q����!� �'�'��/�4�6�6�3H�3H�3J�J�J�J�	K�56�6���G�O�O�$�6��6��
��
�
�	
�
�		K�	K��7s�?B)�6B5�)B2c�J�d}|j|�}|t|�k(sJ�y�Nr)r�reprrs   r�	test_reprzTestEncoding.test_reprMs&��#���y�y�����t�D�z�!�!�!rN)
�__name__�
__module__�__qualname__�__doc__rrrr%r(r-r6rGrKr:rrr
r
s4��:�N�
>�
;�
2�9�
W�
1�
�"rr
c�v�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zy)�TestFormatterszrTest the formatting feature, used by methods like decode() and
    prettify(), and the formatters themselves.
    c�z�d}|j|�}|jd��}||jd�k(sJ�y�N�#<b>&lt;&lt;Sacré bleu!&gt;&gt;</b>�minimal��	formatter�r�decode�document_for�rr4r�decodeds    r�!test_default_formatter_is_minimalz0TestFormatters.test_default_formatter_is_minimalX�G��W���y�y�� ���+�+�	�+�2���$�+�+�R�
�
�	
�
rc�z�d}|j|�}|jd��}||jd�k(sJ�y)N�'<br><b>&lt;&lt;Sacré bleu!&gt;&gt;</b>rrVz.<br/><b>&lt;&lt;Sacr&eacute; bleu!&gt;&gt;</b>rXr[s    r�test_formatter_htmlz"TestFormatters.test_formatter_htmlasL��V�	��y�y�� ���+�+��+�/���$�+�+�<�
�
�	
�
rc�z�d}|j|�}|jd��}||jd�k(sJ�y)Nr`�html5rVz-<br><b>&lt;&lt;Sacr&eacute; bleu!&gt;&gt;</b>rXr[s    r�test_formatter_html5z#TestFormatters.test_formatter_html5ksL��V�	��y�y�� ���+�+��+�0���$�+�+�;�
�
�	
�
rc�z�d}|j|�}|jd��}||jd�k(sJ�yrSrXr[s    r�test_formatter_minimalz%TestFormatters.test_formatter_minimalur^rc�z�d}|j|�}|jd��}||jd�k(sJ�y)NrTrVu<b><<Sacré bleu!>></b>rXr[s    r�test_formatter_nullz"TestFormatters.test_formatter_null~sI��W���y�y�� ���+�+��+�-���$�+�+�F�
�
�	
�
rc�|�d}|j|�}|jd���}||jd�k(sJ�y)Nz!<b>&lt;foo&gt;</b><b>bar</b><br/>c�"�|j�S�N��upper�r<s r�<lambda>z6TestFormatters.test_formatter_custom.<locals>.<lambda>�s��!�'�'�)�rrVz<b><FOO></b><b>BAR</b><br/>rXr[s    r�test_formatter_customz$TestFormatters.test_formatter_custom�sB��4���y�y�� ���+�+�(;�+�<���$�+�+�,I�J�J�J�Jrc�2�d}|j|�}|j}d}||j�k(sJ�||jd��k(sJ�d}||jd��k(sJ�||jd��k(sJ�d}||jd���k(sJ�y)	Nu%<a href="http://a.com?a=b&c=é">e</a>u)<a href="http://a.com?a=b&amp;c=é">e</a>rUrVz/<a href="http://a.com?a=b&amp;c=&eacute;">e</a>ru%<a href="HTTP://A.COM?A=B&C=É">E</a>c�"�|j�Srkrlrns rrozJTestFormatters.test_formatter_is_run_on_attribute_values.<locals>.<lambda>�s��A�G�G�I�r)r�arY)rr4rrs�expect_minimal�expect_html�expect_uppers       r�)test_formatter_is_run_on_attribute_valuesz8TestFormatters.test_formatter_is_run_on_attribute_values�s���8���y�y�� ���F�F��D�������+�+�+�����I��!>�>�>�>�G���a�h�h��h�8�8�8�8�����D��1�1�1�1�>���q�x�x�2E�x�F�F�F�Frc�H�d}t|d�j�}d|vsJ�y)NzO
  <script type="text/javascript">
   console.log("< < hey > > ");
  </script>
�html.parser�< < hey > >�rr�r�docr5s   r�2test_formatter_skips_script_tag_for_html_documentszATestFormatters.test_formatter_skips_script_tag_for_html_documents��.����
 ��]�3�:�:�<����(�(�(rc�H�d}t|d�j�}d|vsJ�y)NzF
  <style type="text/css">
   console.log("< < hey > > ");
  </style>
ryrzr{r|s   r�1test_formatter_skips_style_tag_for_html_documentsz@TestFormatters.test_formatter_skips_style_tag_for_html_documents�rrc�d�|jd�}d|jj�k(sJ�y)NzN<div>  foo  <pre>  	bar
  
  </pre>  baz  <textarea> eee
fff	</textarea></div>zP<div>
 foo
 <pre>  	bar
  
  </pre>
 baz
 <textarea> eee
fff	</textarea>
</div>
�r�div�prettify�rrs  r�,test_prettify_leaves_preformatted_text_alonez;TestFormatters.test_prettify_leaves_preformatted_text_alone�s8���y�y�a�
��
j��x�x� � �"�
#�	
�
#rc�l�d}d}|j|�}||jj�k(sJ�y)NzR<div><pre><code>some
<script><pre>code</pre></script> for you 
</code></pre></div>zV<div>
 <pre><code>some
<script><pre>code</pre></script> for you 
</code></pre>
</div>
r�)rr4�expectrs    r�0test_prettify_handles_nested_string_literal_tagsz?TestFormatters.test_prettify_handles_nested_string_literal_tags�s;�������y�y�� ������*�*�,�,�,�,rc�N�tdd�}|jd���}d|vsJ�y)Nz<html><body>foo</body></html>ryc�"�|j�Srkrlrns rrozITestFormatters.test_prettify_accepts_formatter_function.<locals>.<lambda>�s��1�7�7�9�rrV�FOO)rr�)rr�prettys   r�(test_prettify_accepts_formatter_functionz7TestFormatters.test_prettify_accepts_formatter_function�s,���<�m�L�����)<��=������rc�h�|jd�}tt|j��usJ�y)N�<a></a>)rrA�typer�r�s  r�(test_prettify_outputs_unicode_by_defaultz7TestFormatters.test_prettify_outputs_unicode_by_default�s)���y�y��#���d�4�=�=�?�+�+�+�+rc�j�|jd�}tt|jd��usJ�y)Nr�r
)r�bytesr�r�r�s  r�test_prettify_can_encode_dataz,TestFormatters.test_prettify_can_encode_data�s,���y�y��#����T�]�]�7�3�4�4�4�4rc��d}|j|�}|jjd�}||jd�k(sJ�y)Nu<b>Sacré bleu!</b>r
r)rr4rr5s    r�,test_html_entity_substitution_off_by_defaultz;TestFormatters.test_html_entity_substitution_off_by_default�s>��G���y�y�� ���&�&�-�-��(���&�-�-��0�0�0�0rc�(�d}|j|�}|jddk(sJ�|jd�}d|vsJ�|jd�}d|vsJ�|jd�}d	|vsJ�|jd
�jd
�}d|vsJ�y)NzE<meta content="text/html; charset=x-sjis" http-equiv="Content-type"/>�contentztext/html; charset=x-sjisr
s
charset=utf-8�euc_jpscharset=euc_jpz	shift-jisscharset=shift-jiszutf-16zcharset=utf-16)r�metarrY)r�meta_tagr�utf_8r��	shift_jis�utf_16_us       r�test_encoding_substitutionz)TestFormatters.test_encoding_substitution�s���
W�	��y�y��"���y�y��#�'B�B�B�B����G�$���5�(�(�(����X�&�� �F�*�*�*��K�K��,�	�#�y�0�0�0��;�;�x�(�/�/��9���8�+�+�+rc��d}td�}|j||��}|jdjdk(sJ�y)Nz`<head><meta content="text/html; charset=x-sjis" http-equiv="Content-type"/></head><pre>foo</pre>�pre)�
parse_onlyr)rr�contents�name)rr4�strainerrs    r�;test_encoding_substitution_doesnt_happen_if_tag_is_strainedzJTestFormatters.test_encoding_substitution_doesnt_happen_if_tag_is_strainedsG��
?�	� ��&���y�y��H�y�5���}�}�Q��$�$��-�-�-rN)rLrMrNrOr]rardrfrhrprwr~r�r�r�r�r�r�r�r�r�r:rrrQrQSs^���
�
�
�
�
�K�G�")�)�	
�-�0�
,�5�1�,�2.rrQc�R�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zy
)�TestPersistencez*Testing features like pickle and deepcopy.c�R�d|_|j|j�|_y)Nay<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Beautiful Soup: We called him Tortoise because he taught us.</title>
<link rev="made" href="mailto:leonardr@segfault.org">
<meta name="Description" content="Beautiful Soup: an HTML parser optimized for screen-scraping.">
<meta name="generator" content="Markov Approximation 1.4 (module: leonardr)">
<meta name="author" content="Leonard Richardson">
</head>
<body>
<a href="foo">foo</a>
<a href="foo"><b>bar</b></a>
</body>
</html>)�pager�tree)rs r�setup_methodzTestPersistence.setup_methods!����	� �I�I�d�i�i�(��	rc���tj|jd�}tj|�}|jt
k(sJ�|j
�|jj
�k(sJ�y)N�)�pickle�dumpsr��loads�	__class__rrY)r�dumped�loadeds   r�!test_pickle_and_unpickle_identityz1TestPersistence.test_pickle_and_unpickle_identity&s[�����d�i�i��+�����f�%�����=�0�0�0��}�}��$�)�)�"2�"2�"4�4�4�4rc��tj|j�}|j�|jj�k(sJ�yrk)�copy�deepcopyr�rY)r�copieds  r�test_deepcopy_identityz&TestPersistence.test_deepcopy_identity.s5�����t�y�y�)���}�}��$�)�)�"2�"2�"4�4�4�4rc��tj�dz}d|z}|j|�}tj|�tj|�y)Nrr/)r0r1rr�r�)rr3r4rs    r� test_copy_deeply_nested_documentz0TestPersistence.test_copy_deeply_nested_document3sF���%�%�'�!�+���E�!���y�y�� ���	�	�$���
�
�d�rc��tdd�}|j}|j�}dt|�k(sJ�||jk(sJ�y)Ns
<p>&nbsp;</p>ryu	<p> </p>)r�original_encoding�__copy__rA)rrr+r�s    r�test_copy_preserves_encodingz,TestPersistence.test_copy_preserves_encoding?sK���-�}�=���)�)���}�}����c�$�i�'�'�'��4�1�1�1�1�1rc��|jd�j}d|_d|_|j	�}|j|jk(sJ�|j|jk(sJ�|j
|j
k(sJ�|j|jk(sJ�|j|jk(sJ�|j|jk(sJ�y)Nz<p></p>�
�!)	r�p�
sourceline�	sourceposr��can_be_empty_element�cdata_list_attributes�preserve_whitespace_tags�interesting_string_types)r�tagr�s   r�'test_copy_preserves_builder_informationz7TestPersistence.test_copy_preserves_builder_informationFs����i�i�	�"�$�$�������
�������~�~��!2�!2�2�2�2��}�}�� 0� 0�0�0�0��'�'�6�+F�+F�F�F�F��(�(�F�,H�,H�H�H�H��+�+�v�/N�/N�N�N�N��+�+�v�/N�/N�N�N�Nrc���d}|j|�}tj|tj�}tj|�}|j�|j�k(sJ�yrI)rr�r��HIGHEST_PROTOCOLr�rY)rrrr�r�s     r�test_unicode_picklez#TestPersistence.test_unicode_pickleXsR��#���y�y�������d�F�$;�$;�<�����f�%���}�}��$�+�+�-�/�/�/rc�&�d}|j|�}|jd��}tj|�}||k(sJ�d|jusJ�d|jusJ�d|j
usJ�d|j
usJ�d|jusJ�y)Nz<b>Foo<a></a></b><b>Bar</b>�Foo�r)r�findr��parent�next_element�next_sibling�previous_element�rrr�s1�s2s     r�1test_copy_navigablestring_is_not_attached_to_treezATestPersistence.test_copy_navigablestring_is_not_attached_to_tree`s���,���y�y����
�Y�Y�e�Y�
$��
�Y�Y�r�]���R�x��x��r�y�y� � � ��r���&�&�&��2�?�?�*�*�*��r���&�&�&��r�*�*�*�*�*rc��d}|j|�}|j}tj|�}||k(sJ�t|t�sJ�y)Nz<b><!--Foo--></b>)rrr��
isinstancerr�s     r�0test_copy_navigablestring_subclass_has_same_typez@TestPersistence.test_copy_navigablestring_subclass_has_same_typelsE��"���y�y����
�[�[��
�Y�Y�r�]���R�x��x��"�g�&�&�&rc�b�d}|j|�}tj|�}||k(sJ�y)Nz)<div><b>Foo<a></a></b><b>Bar</b></div>end)rr�)rrr�	soup_copys    r�test_copy_entire_soupz%TestPersistence.test_copy_entire_soupts/��:���y�y�����I�I�d�O�	��y� � � rc�B�d}|j|�}|j}tj|�}t|�t|�k(sJ�||k(sJ�||usJ�d|jusJ�d|j
usJ�d|j
d��jusJ�d|j
d��jusJ�|d|dusJ�|djd�dj�|dk(sJ�dj�|dk(sJ�t|dt�sJ�y)Nz7<div class='a b c'><b>Foo<a></a></b><b>Bar</b></div>end�Barr��class�dza b c dza b c)rr�r�rAr�r�r�r��append�splitr�r)rrrr��div_copys     r�test_copy_tag_copies_contentsz-TestPersistence.test_copy_tag_copies_contentszs7��H���y�y�����h�h���9�9�S�>���3�x�3�x�=�(�(�(��h�����(�"�"�"��x���&�&�&��x�0�0�0�0�0��x�}�}�E�}�2�?�?�?�?�?��3�8�8�5�8�1�>�>�>�>�>��7�|�8�G�#4�4�4�4��G����C� ���� �C��L�0�0�0��}�}��(�7�"3�3�3�3��(�7�+�-?�@�@�@rN)rLrMrNrOr�r�r�r�r�r�r�r�r�r�r�r:rrr�r�s>��0�)�&5�5�

�2�O�$0�
+�'�!�Arr�c��eZdZd�Zd�Zy)�TestEqualityc��|jd�}|jd�\}}|jd��\}}||k(sJ�||cxk(rdk(sJ�J�|dk7sJ�y)N�<a>string</a> <a>string</a>rsrr�sstring)r�find_all�rr�first_a�second_a�first_string�
second_strings      r�test_comparisonzTestEquality.test_comparison�st���y�y�6�7�� �M�M�#�.����&*�m�m�8�m�&D�#��m��(�"�"�"��}�8��8�8�8�8�8��y�(�(�(rc�2�|jd�}|jd�\}}|jd��\}}t|�t|�k(sJ�t|�t|�k7sJ�t|�t|�cxk(rtd�k(sJ�J�y)Nr�rsrr�)rr��hash�idr�s      r�	test_hashzTestEquality.test_hash�s����y�y�6�7�� �M�M�#�.����&*�m�m�8�m�&D�#��m��G�}��X��.�.�.��'�{�b��l�*�*�*��L�!�T�-�%8�J�D��N�J�J�J�J�JrN)rLrMrNr�r�r:rrr�r��s
��
)�
Krr�)rOr�r�r"r0r>�bs4r�bs4.elementrr�
bs4.filterr�rr
rQr�r�r:rr�<module>r�sd��0��
�
�
����$��
<"�8�<"�~z.�X�z.�zDA�h�DA�NK�8�Kr

Youez - 2016 - github.com/yon3zu
LinuXploit