HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/site-packages/bs4/tests/__pycache__/test_tree.cpython-311.pyc
�

��nc��N�dZddlmZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZm
Z
mZmZmZmZmZmZmZmZmZddlmZmZGd	�d
e��ZGd�de��ZGd
�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��Z Gd�de��Z!Gd�de��Z"Gd�de"��Z#Gd�de"��Z$Gd�d e��Z%Gd!�d"e%��Z&Gd#�d$e%��Z'Gd%�d&e��Z(Gd'�d(e��Z)dS))a8Tests for Beautiful Soup's tree traversal methods.

The tree traversal methods are the main advantage of using Beautiful
Soup over just using a parser.

Different parsers will build different Beautiful Soup trees given the
same markup, but all Beautiful Soup trees can be traversed with the
methods tested here.
�)�	set_traceN)�
BeautifulSoup)�builder_registry�HTMLParserTreeBuilder)�CData�Comment�Declaration�Doctype�	Formatter�NavigableString�Script�SoupStrainer�
Stylesheet�Tag�TemplateString�)�SoupTest�skipIfc�0�eZdZdZd�Zd�Zd�Zd�Zd�ZdS)�TestFindz�Basic tests of the find() method.

    find() just calls find_all() with limit=1, so it's not tested all
    that thouroughly here.
    c�p�|�d��}|�d��jdksJ�dS)Nz <a>1</a><b>2</b><a>3</a><b>4</b>�b�2)�soup�find�string��selfrs  �5D:\Python311\Lib\site-packages\bs4/tests/test_tree.py�
test_find_tagzTestFind.test_find_tag.s8���y�y�;�<�<���y�y��~�~�$��+�+�+�+�+�+�c�h�|�d��}|�d���dksJ�dS)Nu<h1>Räksmörgås</h1>�
Räksmörgås�r)rrrs  r�test_unicode_text_findzTestFind.test_unicode_text_find2s9���y�y�1�2�2���y�y��y�0�0�O�C�C�C�C�C�Cr!c��|�d��}t|��d|�d���jksJ�dS)Nu&<h1 id="Räksmörgås">here it is</h1>z
here it isr#��id)r�strr�textrs  r�test_unicode_attribute_findz$TestFind.test_unicode_attribute_find6sG���y�y�A�B�B���D�	�	�	��t�y�y�O�y�<�<�A�A�A�A�A�A�Ar!c�~�|�d��}dt|�����ksJ�dS)z)Test an optimization that finds all tags.�<a>foo</a><b>bar</b>�N�r�len�find_allrs  r�test_find_everythingzTestFind.test_find_everything<s;���y�y�/�0�0���C��
�
���(�(�(�(�(�(�(�(r!c��|�d��}dt|�d����ksJ�dS)z;Test an optimization that finds all tags with a given name.z<a>foo</a><b>bar</b><a>baz</a>r.�aNr/rs  r�test_find_everything_with_namez'TestFind.test_find_everything_with_nameAs?���y�y�9�:�:���C��
�
�c�*�*�+�+�+�+�+�+�+�+r!N)	�__name__�
__module__�__qualname__�__doc__r r%r+r2r5�r!rrr'so��������,�,�,�D�D�D�B�B�B�)�)�)�
,�,�,�,�,r!rc�0�eZdZdZd�Zd�Zd�Zd�Zd�ZdS)�TestFindAllz%Basic tests of the find_all() method.c�F�|�d��}|�d���dgksJ�|�ddg���ddgksJ�|�tjd�����gd�ksJ�|�d���gd�ksJ�dS)	z'You can search the tree for text nodes.u<html>Foo<b>bar</b>»</html>�barr$�Fooz.*)r?r>�»TN)rr1�re�compilers  r�test_find_all_text_nodesz$TestFindAll.test_find_all_text_nodesIs����y�y�9�:�:���}�}�E�}�*�*�u�g�5�5�5�5��}�}�U�E�N�}�3�3��u�~�E�E�E�E��}�}�B�J�t�$4�$4�}�5�5�9O�9O�9O�O�O�O�O��}�}�D�}�)�)�-C�-C�-C�C�C�C�C�C�Cr!c��|�d��}|�|�dd���gd���|�|�dd���dg��|�|�dd���gd	���|�|�dd
���gd	���dS)z7You can limit the number of items returned by find_all.z(<a>1</a><a>2</a><a>3</a><a>4</a><a>5</a>r4���limit)�1r�3rrH�
)rHrrI�4�5rN�r�assert_selectsr1rs  r�test_find_all_limitzTestFindAll.test_find_all_limitWs����y�y�C�D�D�����D�M�M�#�Q�M�7�7����I�I�I����D�M�M�#�Q�M�7�7�#��?�?�?�����M�M�#�R�M�(�(�*C�*C�*C�	E�	E�	E�	
����M�M�#�Q�M�'�'�)B�)B�)B�	D�	D�	D�	D�	Dr!c���|�d��}|�|dd���dg��|�|�d���dg��dS)	Nz!<a>1</a><b>2<a id='foo'>3</a></b>r4rrFrH�foor'rI)rrNrrs  r�%test_calling_a_tag_is_calling_findallz1TestFindAll.test_calling_a_tag_is_calling_findallcsg���y�y�<�=�=�����D�D��A�.�.�.���6�6�6����D�F�F�e�F�,�,�s�e�4�4�4�4�4r!c��|�d��}g}|�|��g|�|��ksJ�dS)N�<a></a>)r�appendr1)rr�ls   r�Ttest_find_all_with_self_referential_data_structure_does_not_cause_infinite_recursionz`TestFindAll.test_find_all_with_self_referential_data_structure_does_not_cause_infinite_recursionhsL���y�y��#�#����	��������T�]�]�1�%�%�%�%�%�%�%�%r!c��|�d��}|�d��}t|d��sJ�|�d��}t|d��sJ�|�d���}t|d��sJ�dS)z%All find_all calls return a ResultSetrTr4�sourceTrQr$N)rr1�hasattr)rr�results   r�test_find_all_resultsetz#TestFindAll.test_find_all_resultsetrs����y�y��#�#�����s�#�#���v�x�(�(�(�(�(����t�$�$���v�x�(�(�(�(�(����e��,�,���v�x�(�(�(�(�(�(�(r!N)	r6r7r8r9rCrOrRrWr\r:r!rr<r<Fsk������/�/�D�D�D�
D�
D�
D�5�5�5�
&�&�&�
)�
)�
)�
)�
)r!r<c��eZdZd�ZdS)�TestFindAllBasicNamespacesc��|�d��}d|�d��jksJ�d|�ddi���jksJ�dS)Nz0<mathml:msqrt>4</mathml:msqrt><a svg:fill="red">rKzmathml:msqrtr4zsvg:fill�red��attrs)rrr�namers  r�test_find_by_namespaced_namez7TestFindAllBasicNamespaces.test_find_by_namespaced_name�sa���y�y�K�L�L���d�i�i��/�/�6�6�6�6�6��d�i�i��e�'=�i�>�>�C�C�C�C�C�C�Cr!N)r6r7r8rdr:r!rr^r^s(������D�D�D�D�Dr!r^c�T�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
S)�TestFindAllByNamez&Test ways of finding tags by tag name.c�:�|�d��|_dS)Nz�<a>First tag.</a>
                                  <b>Second tag.</b>
                                  <c>Third <a>Nested tag.</a> tag.</c>�r�tree�rs r�setup_methodzTestFindAllByName.setup_method�s#���Y�Y� J�K�K��	�	�	r!c�f�|�|j�d��ddg��dS�Nr4�
First tag.�Nested tag.�rNrir1rjs r�test_find_all_by_tag_namez+TestFindAllByName.test_find_all_by_tag_name�sC������I���s�#�#�l�M�%B�	D�	D�	D�	D�	Dr!c�T�|�|j�dd���dg��|�|j�dd���ddg��|�|j�dtjd�����ddg��dS)Nr4rnr$Tro�tag�rNrir1rArBrjs r�test_find_all_by_name_and_textz0TestFindAllByName.test_find_all_by_name_and_text�s�������I���s�<��8�8�<�.�	J�	J�	J�	
����I���s�4��0�0�<��2O�	Q�	Q�	Q�	
����I���s�2�:�e�+<�+<��=�=�
�=�)�	+�	+�	+�	+�	+r!c�n�|�|jj�d��dg��dS)Nr4ro)rNri�cr1rjs r�!test_find_all_on_non_root_elementz3TestFindAllByName.test_find_all_on_non_root_element�s2�����D�I�K�0�0��5�5�
��G�G�G�G�Gr!c�\�|�|�d��ddg��dSrm)rNrirjs r�%test_calling_element_invokes_find_allz7TestFindAllByName.test_calling_element_invokes_find_all�s-�����D�I�I�c�N�N�\�=�,I�J�J�J�J�Jr!c��|�|j�td����ddg��dSrm)rNrir1rrjs r�test_find_all_by_tag_strainerz/TestFindAllByName.test_find_all_by_tag_strainer�sG������I���|�C�0�0�1�1�
�=�)�	+�	+�	+�	+�	+r!c�j�|�|j�ddg��gd���dS)Nr4r�rnzSecond tag.rorprjs r�test_find_all_by_tag_namesz,TestFindAllByName.test_find_all_by_tag_names�sD������I����S�z�*�*�8�8�8�	:�	:�	:�	:�	:r!c�l�|�|j�ddd���gd���dS)NT)r4rr~rprjs r�test_find_all_by_tag_dictz+TestFindAllByName.test_find_all_by_tag_dict�sH������I���d�$�7�7�8�8�8�8�8�	:�	:�	:�	:�	:r!c��|�|j�tjd����gd���dS)Nz^[ab]$r~rtrjs r�test_find_all_by_tag_rez)TestFindAllByName.test_find_all_by_tag_re�sJ������I���r�z�(�3�3�4�4�8�8�8�	:�	:�	:�	:�	:r!c��d�}|�d��}|�|�|��ddg��dS)Nc�>�|j|�d��kS�Nr()rc�get)rss r�id_matches_namezRTestFindAllByName.test_find_all_with_tags_matching_method.<locals>.id_matches_name�s���8�s�w�w�t�}�}�,�,r!z�<a id="a">Match 1.</a>
                            <a id="1">Does not match.</a>
                            <b id="b">Match 2.</a>zMatch 1.zMatch 2.rM)rr�ris   r�'test_find_all_with_tags_matching_methodz9TestFindAllByName.test_find_all_with_tags_matching_method�sj��	-�	-�	-��y�y�6�7�7��	
����M�M�/�*�*�Z��,D�	F�	F�	F�	F�	Fr!c�J�|�d��}|�dd��}|�dtjd����}|�dddg��\}}d|jksJ�d|jksJ�d|jksJ�d|jksJ�dS)NzH<div class='a b'>1</div><div class='a c'>2</div><div class='a d'>3</div>�divza dza brIrH)rrrArBr1r)rr�r1�r2�r3�r4s      r�%test_find_with_multi_valued_attributez7TestFindAllByName.test_find_with_multi_valued_attribute�s����y�y�V�
�
���Y�Y�u�e�
$�
$��
�Y�Y�u�b�j��0�0�
1�
1�����u�u�e�n�5�5���B��b�i������b�i������b�i������b�i������r!N)r6r7r8r9rkrqrurxrzr|rr�r�r�r�r:r!rrfrf�s�������0�0�K�K�K�
D�D�D�
	+�	+�	+�H�H�H�K�K�K�+�+�+�
:�:�:�
:�:�:�
:�:�:�
F�F�F�
 �
 �
 �
 �
 r!rfc�n�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZdS)�TestFindAllByAttributec��|�d��}|�|�d���ddg��dS)Nz�
                         <a id="first">Matching a.</a>
                         <a id="second">
                          Non-matching <b id="first">Matching b.</b>a.
                         </a>�firstr'zMatching a.zMatching b.rM�rris  r�test_find_all_by_attribute_namez6TestFindAllByAttribute.test_find_all_by_attribute_name�sX���y�y�!�"�"��
	
���D�M�M�W�M�5�5�)�=�9�	;�	;�	;�	;�	;r!c��d�d��}d�d��}|�|��}|jg|�|���ksJ�|jg|�|�d�����ksJ�|jgs J|�|dg������dS)Nuםולש�utf8u<a title="םולש"></a>)�titlezsomething else)�encoderr4r1�decode)r�peace�datars    r�%test_find_all_by_utf8_attribute_valuez<TestFindAllByAttribute.test_find_all_by_utf8_attribute_value�s����!�!�&�)�)��)�0�0��8�8���y�y�������x�4�=�=�u�=�5�5�5�5�5�5���x�4�=�=�u�|�|�F�/C�/C�=�D�D�D�D�D�D���x�G�G����e�5E�-F��G�G�G�G�G�G�Gr!c�:�|�d��}|�|�d���dg��|�|�ddi���dg��|�|�dd	i���d
g��dS)Na0
                         <a name="name1" class="class1">Name match.</a>
                         <a name="name2" class="class2">Class match.</a>
                         <a name="name3" class="class3">Non-match.</a>
                         <name1>A tag called 'name1'.</name1>
                         �name1�rczA tag called 'name1'.rcrazName match.�class�class2zClass match.rMr�s  r�test_find_all_by_attribute_dictz6TestFindAllByAttribute.test_find_all_by_attribute_dict�s����y�y�����	
���D�M�M�w�M�7�7�3�4�	6�	6�	6�	
���D�M�M��'�0B�M�C�C�)�?�	,�	,�	,�	
���D�M�M��8�0D�M�E�E�*�+�	-�	-�	-�	-�	-r!c��|�d��}|�|�dd���dg��|�|�dd���dg��|�|�dd	���dg��|�|�dd��dg��|�|�d�
��ddg��|�|�dd��dg��|�|�dd	��dg��dS)Nz�
                         <a class="1">Class 1.</a>
                         <a class="2">Class 2.</a>
                         <b class="1">Class 1.</b>
                         <c class="3 4">Class 3 and 4.</c>
                         r4rH��class_zClass 1.rwrIzClass 3 and 4.rKrarMr�s  r�test_find_all_by_classz-TestFindAllByAttribute.test_find_all_by_class�s?���y�y�����	
���D�M�M�#�c�M�:�:�Z�L�I�I�I����D�M�M�#�c�M�:�:�=M�<N�O�O�O����D�M�M�#�c�M�:�:�=M�<N�O�O�O�	
���D�M�M�#�s�3�3�j�\�B�B�B����D�M�M��M�4�4�z�:�6N�O�O�O����D�M�M�#�s�3�3�6F�5G�H�H�H����D�M�M�#�s�3�3�6F�5G�H�H�H�H�Hr!c��|�d��}|�dtjd�����}|�|dg��|�dtjd�����}|�|dg��|�dtjd�����}|�|dg��dS)Nz#<gar class='foo bar'>Found it</gar>�gar�or��Found itr4zo b)rr1rArBrN)rri�fs   r�0test_find_by_class_when_multiple_classes_presentzGTestFindAllByAttribute.test_find_by_class_when_multiple_classes_presents����y�y�>�?�?���M�M�%��
�3���M�8�8�����A�
�|�,�,�,��M�M�%��
�3���M�8�8�����A�
�|�,�,�,�
�M�M�%��
�5�(9�(9�M�:�:�����A�
�|�,�,�,�,�,r!c�`�|�d��}|�|�dtjd����dg��d�}|�|�d|��g��d�}|�|�d|��dg��dS)Nz<a class='bar'>Found it</a>r4�bar�c�(�t|��dkS�NrE�r0��values r�big_attribute_valueznTestFindAllByAttribute.test_find_all_with_non_dictionary_for_attrs_finds_by_class.<locals>.big_attribute_value&s���u�:�:��>�!r!c�(�t|��dkSr�r�r�s r�small_attribute_valuezpTestFindAllByAttribute.test_find_all_with_non_dictionary_for_attrs_finds_by_class.<locals>.small_attribute_value+s���u�:�:��?�"r!�rrNr1rArB)rrr�r�s    r�:test_find_all_with_non_dictionary_for_attrs_finds_by_classzQTestFindAllByAttribute.test_find_all_with_non_dictionary_for_attrs_finds_by_class!s����y�y�6�7�7�����D�M�M�#�r�z�$�/?�/?�@�@�:�,�O�O�O�	"�	"�	"�	
���D�M�M�#�/B�C�C�R�H�H�H�	#�	#�	#�	
����M�M�#�4�5�5�
�|�	E�	E�	E�	E�	Er!c��|�d��}|�d��\}}||gsJ|�dd�����|gsJ|�dd�����|g|�dd���ksJ�|g|�dd��ksJ�g|�dd��ksJ�dS)Nz*<a class="foo bar"></a><a class="foo"></a>r4rQr>zfoo barr�zbar foo�rr1)rrr4�a2s    r�:test_find_all_with_string_for_attrs_finds_multiple_classeszQTestFindAllByAttribute.test_find_all_with_string_for_attrs_finds_multiple_classes1s����y�y�E�F�F���
�
�c�"�"���2��2�w�1�1��
�
�c�5�1�1�1�1�1��s�-�-�D�M�M�#�u�-�-�-�-�-��s�d�m�m�C�	�m�:�:�:�:�:�:��s�d�m�m�C��3�3�3�3�3�3��T�]�]�3�	�2�2�2�2�2�2�2�2r!c��|�d��}tddi���}|�|�|��dg��dS)Nzi
                         <a id="first">Match.</a>
                         <a id="second">Non-match.</a>r(r�razMatch.)rrrNr1)rri�strainers   r�'test_find_all_by_attribute_soupstrainerz>TestFindAllByAttribute.test_find_all_by_attribute_soupstrainer=s[���y�y�:�;�;�� �t�g�&6�7�7�7�����D�M�M�(�3�3�h�Z�@�@�@�@�@r!c��|�d��}|�|�dd���dg��dS)N��<a id="1">ID present.</a>
                            <a>No ID present.</a>
                            <a id="">ID is empty.</a>r4r'zNo ID present.rMr�s  r�$test_find_all_with_missing_attributez;TestFindAllByAttribute.test_find_all_with_missing_attributeEsN���y�y�9�:�:��	
���D�M�M�#�$�M�7�7�:J�9K�L�L�L�L�Lr!c��|�d��}|�|�d���ddg��dS)Nr�Tr'zID present.zID is empty.rMr�s  r�$test_find_all_with_defined_attributez;TestFindAllByAttribute.test_find_all_with_defined_attributeMs]���y�y�9�:�:��	
����M�M�T�M�"�"�]�N�$C�	E�	E�	E�	E�	Er!c���|�d��}ddg}|�|�d���|��|�|�d���|��dS)Nz[<a id=1>Unquoted attribute.</a>
                            <a id="1">Quoted attribute.</a>zUnquoted attribute.zQuoted attribute.rr'rHrM)rri�expecteds   r�$test_find_all_with_numeric_attributez;TestFindAllByAttribute.test_find_all_with_numeric_attributeVsw���y�y�?�@�@��*�+>�?�����D�M�M�Q�M�/�/��:�:�:����D�M�M�S�M�1�1�8�<�<�<�<�<r!c��|�d��}|�|�gd����ddg��dS)Nz�<a id="1">1</a>
                            <a id="2">2</a>
                            <a id="3">3</a>
                            <a>No ID.</a>)rHrIrKr'rHrIrMr�s  r�(test_find_all_with_list_attribute_valuesz?TestFindAllByAttribute.test_find_all_with_list_attribute_values_s[���y�y�-�.�.��	
���D�M�M�_�_�_�M�=�=���:�	'�	'�	'�	'�	'r!c��|�d��}|�|�tjd�����ddg��dS)Nz�<a id="a">One a.</a>
                            <a id="aa">Two as.</a>
                            <a id="ab">Mixed as and bs.</a>
                            <a id="b">One b.</a>
                            <a>No ID.</a>z^a+$r'zOne a.zTwo as.r�r�s  r�5test_find_all_with_regular_expression_attribute_valuezLTestFindAllByAttribute.test_find_all_with_regular_expression_attribute_valueisb���y�y�-�.�.��	
���D�M�M�R�Z��-?�-?�M�@�@�$�i�0�	2�	2�	2�	2�	2r!c��|�d��}|j}|g|�dd���ksJ�g|�dd���ksJ�dS)Nz<b>foo</b><b>bar</b><a>foo</a>r4rQr$r>�rr4r1�rrr4s   r�'test_find_by_name_and_containing_stringz>TestFindAllByAttribute.test_find_by_name_and_containing_stringvse���y�y�9�:�:���F���s�d�m�m�C��m�6�6�6�6�6�6��T�]�]�3�u�]�5�5�5�5�5�5�5�5r!c��|�d��}|�d��|�dd���ksJ�dS)Nz"<a>foo</a><a><b><c>foo</c></b></a>r4rQr$r�rs  r�=test_find_by_name_and_containing_string_when_string_is_buriedzTTestFindAllByAttribute.test_find_by_name_and_containing_string_when_string_is_buried}sG���y�y�=�>�>���}�}�S�!�!�T�]�]�3�u�]�%E�%E�E�E�E�E�E�Er!c��|�d��}|j}|g|�dd���ksJ�g|�dd���ksJ�dS)Nz"<b id="1">foo</b><a id="2">foo</a>r.rQ)r(rrr>r�r�s   r�,test_find_by_attribute_and_containing_stringzCTestFindAllByAttribute.test_find_by_attribute_and_containing_string�se���y�y�=�>�>���F���s�d�m�m�q��m�7�7�7�7�7�7��T�]�]�a��]�6�6�6�6�6�6�6�6r!N)r6r7r8r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r:r!rr�r��s������	;�	;�	;�H�H�H�-�-�-�*I�I�I�(-�-�-�E�E�E� 
3�
3�
3�A�A�A�M�M�M�E�E�E�=�=�=�'�'�'�2�2�2�6�6�6�F�F�F�7�7�7�7�7r!r�c��eZdZdZd�ZdS)�
TestSmoothzTest Tag.smooth.c�V�|�d��}|j}|�d��|�d��|�td����|�td����|�d��|���}t||d��}|�d��|�d	��|�|��d|jjksJ�d
t|j	��ksJ�|�
��dt|j	��ksJ�d|j	d
ksJ�d|jjksJ�d|j	dksJ�d|j	dksJ�dS)Nz<div>a</div>rrwz	Comment 1z	Comment 2�d�spanrHr���abcr�12rr.)rr�rUr�default_builderrr�rr0�contents�smooth)rrr��builderr�s     r�test_smoothzTestSmooth.test_smooth�s����y�y��(�(���h���
�
�3�����
�
�3�����
�
�7�;�'�'�(�(�(��
�
�7�;�'�'�(�(�(��
�
�3�����&�&�(�(���4��&�)�)�����C�������C�����
�
�4�����s�x��&�&�&�&��C���%�%�%�%�%�%��
�
�����C���%�%�%�%�%�%�
���Q��'�'�'�'��s�x��&�&�&�&�
�c�l�1�o�-�-�-�-��c�l�1�o�-�-�-�-�-�-r!N)r6r7r8r9r�r:r!rr�r��s)��������&.�&.�&.�&.�&.r!r�c��eZdZdZd�ZdS)�	TestIndexzTest Tag.indexc�6�|�d��}|j}t|j��D] \}}||�|��ksJ��!tjt��5|�d��ddd��dS#1swxYwYdS)Nah<div>
                            <a>Identical</a>
                            <b>Not identical</b>
                            <a>Identical</a>

                            <c><d>Identical with child</d></c>
                            <b>Also not identical</b>
                            <c><d>Identical with child</d></c>
                            </div>r)rr��	enumerater��index�pytest�raises�
ValueError)rrir��i�elements     r�
test_indexzTestIndex.test_index�s����y�y�&�'�'���h��#�C�L�1�1�	+�	+�J�A�w���	�	�'�*�*�*�*�*�*�*�
�]�:�
&�
&�	�	��J�J�q�M�M�M�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�+B�B�BN)r6r7r8r9r�r:r!rr�r��s)������������r!r�c�H�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZdS)�TestParentOperationsz;Test navigation and searching through an element's parents.c�\�|�d��|_|jj|_dS)Na1<ul id="empty"></ul>
                                 <ul id="top">
                                  <ul id="middle">
                                   <ul id="bottom">
                                    <b>Start here</b>
                                   </ul>
                                  </ul>)rrir�startrjs rrkz!TestParentOperations.setup_method�s-���I�I�+�,�,��	��Y�[��
�
�
r!c��|jjddksJ�|jjjddksJ�|jjjjddksJ�dS)Nr(�bottom�middle�top)r��parentrjs r�test_parentz TestParentOperations.test_parent�sb���z� ��&�(�2�2�2�2��z� �'��-��9�9�9�9��z� �'�.�t�4��=�=�=�=�=�=r!c�N�|jjd}|j|jksJ�dS)Nr)rir�r�)r�top_tags  r�%test_parent_of_top_tag_is_soup_objectz:TestParentOperations.test_parent_of_top_tag_is_soup_object�s,���)�$�Q�'���~���*�*�*�*�*�*r!c�*�d|jjksJ�dS�N)rir�rjs r�test_soup_object_has_no_parentz3TestParentOperations.test_soup_object_has_no_parent�s���t�y�'�'�'�'�'�'�'r!c���|�|j�d��gd���|�|j�dd���dg��dS)N�ul)r�r�r�r�r')�assert_selects_idsr��find_parentsrjs r�test_find_parentsz&TestParentOperations.test_find_parents�s|������J�#�#�D�)�)�+F�+F�+F�	H�	H�	H�����J�#�#�D�X�#�6�6��
�	D�	D�	D�	D�	Dr!c��|j�d��ddksJ�|j�dd���ddksJ�dS)Nrr(r�r�r')r��find_parentrjs r�test_find_parentz%TestParentOperations.test_find_parent�sY���z�%�%�d�+�+�D�1�X�=�=�=�=��z�%�%�d�u�%�5�5�d�;�u�D�D�D�D�D�Dr!c�`�|j�d���}|jjdksJ�dS)N�
Start herer$r)rirr�rc�rr*s  r�test_parent_of_text_elementz0TestParentOperations.test_parent_of_text_element�s3���y�~�~�\�~�2�2���{��3�&�&�&�&�&�&r!c�~�|j�d���}|�d��ddksJ�dS)Nrr$rr(r�)rirrr	s  r�test_text_element_find_parentz2TestParentOperations.test_text_element_find_parent�sA���y�~�~�\�~�2�2������%�%�d�+�x�7�7�7�7�7�7r!c�V�d�|jjD��}|sJdddkg���dS)Nc�4�g|]}|�d|jv�
|d��Sr�ra)�.0r�s  r�
<listcomp>z>TestParentOperations.test_parent_generator.<locals>.<listcomp>�sG��C�C�C�F��C�-1�V�\�-A�C�6�$�<�C�C�Cr!r�r�r�)r��parents)rrs  r�test_parent_generatorz*TestParentOperations.test_parent_generator�sM��C�C�d�j�.@�C�C�C���5�5��8�u�#4�5�5�5�5�5�5r!N)
r6r7r8r9rkr�r�r�rrr
rrr:r!rr�r��s�������E�E�!�!�!�>�>�>�
+�+�+�(�(�(�D�D�D�E�E�E�'�'�'�8�8�8�6�6�6�6�6r!r�c��eZdZd�ZdS)�
ProximityTestc�:�|�d��|_dS)Nzg<html id="start"><head></head><body><b id="1">One</b><b id="2">Two</b><b id="3">Three</b></body></html>rhrjs rrkzProximityTest.setup_method�s ���I�I�u�w�w��	�	�	r!N�r6r7r8rkr:r!rrr�s(������w�w�w�w�wr!rc�H��eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
�xZS)	�TestNextOperationsc�x��tt|�����|jj|_dSr�)�superrrkrirr��r�	__class__s �rrkzTestNextOperations.setup_methods/���
� �$�'�'�4�4�6�6�6��Y�[��
�
�
r!c�d�|jjdksJ�|jjjddksJ�dS)N�Oner(r)r��next_elementrjs r�	test_nextzTestNextOperations.test_nexts<���z�&�%�/�/�/�/��z�&�3�D�9�S�@�@�@�@�@�@r!c�V�|j�d���}|jdksJ�dS�N�Threer$)rirr)r�lasts  r�test_next_of_last_item_is_nonez1TestNextOperations.test_next_of_last_item_is_nones1���y�~�~�W�~�-�-��� �D�(�(�(�(�(�(r!c�*�|jjdksJ�dSr�)rirrjs r�test_next_of_root_is_nonez,TestNextOperations.test_next_of_root_is_nones���y�%��-�-�-�-�-�-r!c��|�|j�d��ddg��|j�d���|�|j�d���dg��dS)Nr�Twor#rEr')rNr��
find_all_nextrjs r�test_find_all_nextz%TestNextOperations.test_find_all_nextsw�����D�J�4�4�S�9�9�E�7�;K�L�L�L��
� � �A� �&�&�&����D�J�4�4��4�:�:�W�I�F�F�F�F�Fr!c��|j�d��ddksJ�|j�d���dksJ�dS)Nrr(rr#r$)r��	find_nextrjs r�test_find_nextz!TestNextOperations.test_find_nextsR���z�#�#�C�(�(��.�#�5�5�5�5��z�#�#�7�#�3�3�w�>�>�>�>�>�>r!c���|j�d���}|�d��jdksJ�|�|�d��ddg��dS)Nrr$rr)r#)rirr-rrNr*r	s  r�test_find_next_for_text_elementz2TestNextOperations.test_find_next_for_text_elementsf���y�~�~�U�~�+�+���~�~�c�"�"�)�U�2�2�2�2����D�.�.�s�3�3�e�W�5E�F�F�F�F�Fr!c��|j�d���}d�|jD��}|\}}|ddksJ�|dksJ�dS)Nr)r$c��g|]}|��Sr:r:�r�nodes  rrz:TestNextOperations.test_next_generator.<locals>.<listcomp>#s��;�;�;�t�d�;�;�;r!r(rIr#)rir�
next_elements)rr��
successorsrsr�s     r�test_next_generatorz&TestNextOperations.test_next_generator!sb���	���e��,�,��;�;�u�':�;�;�;�
�"�
��X��4�y�C������7�"�"�"�"�"�"r!)r6r7r8rkr r%r'r+r.r0r7�
__classcell__�rs@rrrs��������!�!�!�!�!�A�A�A�)�)�)�.�.�.�G�G�G�
?�?�?�G�G�G�
#�#�#�#�#�#�#r!rc�H��eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
�xZS)	�TestPreviousOperationsc���tt|�����|j�d���|_dSr")rr;rkrir�endrs �rrkz#TestPreviousOperations.setup_method+s;���
�$�d�+�+�8�8�:�:�:��9�>�>��>�1�1����r!c�d�|jjddksJ�|jjjdksJ�dS)Nr(rIr))r=�previous_elementrjs r�
test_previousz$TestPreviousOperations.test_previous/s<���x�(��.�#�5�5�5�5��x�(�9�U�B�B�B�B�B�Br!c�T�|j�d��}|jdksJ�dS)N�html)rirr?)rr�s  r�#test_previous_of_first_item_is_nonez:TestPreviousOperations.test_previous_of_first_item_is_none3s/���	���v�&�&���%��-�-�-�-�-�-r!c�*�|jjdksJ�dSr�)rir?rjs r�test_previous_of_root_is_nonez4TestPreviousOperations.test_previous_of_root_is_none7s���y�)�T�1�1�1�1�1�1r!c���|�|j�d��gd���|�|j�d���dg��dS)Nr�r#r)rrr'r)rNr=�find_all_previousrjs r�test_find_all_previousz-TestPreviousOperations.test_find_all_previous;sl��	
����H�&�&�s�+�+�-D�-D�-D�	F�	F�	F����D�H�6�6�!�6�<�<�u�g�F�F�F�F�Fr!c��|j�d��ddksJ�|j�d���dksJ�dS)Nrr(rIrr$)r=�
find_previousrjs r�test_find_previousz)TestPreviousOperations.test_find_previousCsR���x�%�%�c�*�*�4�0�C�7�7�7�7��x�%�%�U�%�3�3�u�<�<�<�<�<�<r!c���|j�d���}|�d��jdksJ�|�|�d��gd���dS)Nr#r$rrG)rirrKrrNrHr	s  r�#test_find_previous_for_text_elementz:TestPreviousOperations.test_find_previous_for_text_elementGsz���y�~�~�W�~�-�-���!�!�#�&�&�-��8�8�8�8�����"�"�3�'�'�)@�)@�)@�	B�	B�	B�	B�	Br!c���|j�d���}d�|jD��}|\}}}}|ddksJ�|jdksJ�|jdksJ�|jdksJ�dS)	Nrr$c��g|]}|��Sr:r:r3s  rrzBTestPreviousOperations.test_previous_generator.<locals>.<listcomp>Os��A�A�A���A�A�Ar!r(rH�body�headrB)rir�previous_elementsrc)rr��predecessorsrrQrRrBs       r�test_previous_generatorz.TestPreviousOperations.test_previous_generatorMs����	���e��,�,��A�A��)@�A�A�A��+���4��t���w�#�~�����y�F�"�"�"�"��y�F�"�"�"�"��y�F�"�"�"�"�"�"r!)r6r7r8rkr@rCrErIrLrNrUr8r9s@rr;r;)s��������2�2�2�2�2�C�C�C�.�.�.�2�2�2�G�G�G�=�=�=�B�B�B�
#�
#�
#�
#�
#�
#�
#r!r;c��eZdZd�ZdS)�SiblingTestc��d}tjd���d|��}|�|��|_dS)Na�<html>
                    <span id="1">
                     <span id="1.1"></span>
                    </span>
                    <span id="2">
                     <span id="2.1"></span>
                    </span>
                    <span id="3">
                     <span id="3.1"></span>
                    </span>
                    <span id="4"></span>
                    </html>z\n\s*�)rArB�subrri)r�markups  rrkzSiblingTest.setup_method\sA������H�%�%�)�)�"�f�5�5���I�I�f�%�%��	�	�	r!Nrr:r!rrWrWZs#������&�&�&�&�&r!rWc�B��eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	�xZ
S)�TestNextSiblingc���tt|�����|j�d���|_dS)NrHr')rr]rkrirr�rs �rrkzTestNextSibling.setup_methodqs:���
�o�t�$�$�1�1�3�3�3��Y�^�^�s�^�+�+��
�
�
r!c�*�|jjdksJ�dSr�)ri�next_siblingrjs r�!test_next_sibling_of_root_is_nonez1TestNextSibling.test_next_sibling_of_root_is_noneus���y�%��-�-�-�-�-�-r!c��|jjddksJ�|jjjddksJ�|jjddksJ�dS)Nr(rrI�1.1)r�r`rrjs r�test_next_siblingz!TestNextSibling.test_next_siblingxs^���z�&�t�,��3�3�3�3��z�&�3�D�9�S�@�@�@�@��z�&�t�,��5�5�5�5�5�5r!c���|jjjdksJ�|j�d���}|jdksJ�|j�d���}|jdksJ�dS)Nrcr'rK)rirBr`r)r�nested_span�	last_spans   r�test_next_sibling_may_not_existz/TestNextSibling.test_next_sibling_may_not_existsr���y�~�*�d�2�2�2�2��i�n�n��n�.�.���'�4�/�/�/�/��I�N�N�c�N�*�*�	��%��-�-�-�-�-�-r!c�R�|j�d��ddksJ�dS)Nr�r(r)r��find_next_siblingrjs r�test_find_next_siblingz&TestNextSibling.test_find_next_sibling�s.���z�+�+�F�3�3�D�9�S�@�@�@�@�@�@r!c���|�|j�d��gd���|�|j�d���dg��dS)Nr�)rrIrKrIr')rr��find_next_siblingsrjs r�test_next_siblingsz"TestNextSibling.test_next_siblings�sf������
� =� =�f� E� E�-�o�o�	/�	/�	/�	
����
� =� =�� =� E� E��u�M�M�M�M�Mr!c�h�|�d��}|�d���}|jjdksJ�|jjdksJ�|�|�d��dg��|�d���dksJ�|�d���dksJ�dS)N�Foo<b>bar</b>bazr?r$r�bazr>�nonesuch)rrr`rcrNrmrj�rrr�s   r�"test_next_sibling_for_text_elementz2TestNextSibling.test_next_sibling_for_text_element�s����y�y�+�,�,���	�	��	�'�'���!�&�#�-�-�-�-��!�.�%�7�7�7�7����E�4�4�S�9�9�E�7�C�C�C��&�&�e�&�4�4��=�=�=�=��&�&�j�&�9�9�T�A�A�A�A�A�Ar!)r6r7r8rkrardrhrkrnrtr8r9s@rr]r]os��������,�,�,�,�,�.�.�.�6�6�6�.�.�.�A�A�A�N�N�N�B�B�B�B�B�B�Br!r]c�B��eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	�xZ
S)�TestPreviousSiblingc���tt|�����|j�d���|_dS)NrKr')rrvrkrirr=rs �rrkz TestPreviousSibling.setup_method�s;���
�!�4�(�(�5�5�7�7�7��9�>�>�S�>�)�)����r!c�*�|jjdksJ�dSr�)ri�previous_siblingrjs r�%test_previous_sibling_of_root_is_nonez9TestPreviousSibling.test_previous_sibling_of_root_is_none�s���y�)�T�1�1�1�1�1�1r!c��|jjddksJ�|jjjddksJ�|jjddksJ�dS)Nr(rIrz3.1)r=ryr?rjs r�test_previous_siblingz)TestPreviousSibling.test_previous_sibling�s^���x�(��.�#�5�5�5�5��x�(�9�$�?�3�F�F�F�F��x�(��.�%�7�7�7�7�7�7r!c���|jjjdksJ�|j�d���}|jdksJ�|j�d���}|jdksJ�dS)Nrcr'rH)rirBryr)rrf�
first_spans   r�#test_previous_sibling_may_not_existz7TestPreviousSibling.test_previous_sibling_may_not_exist�sr���y�~�.�$�6�6�6�6��i�n�n��n�.�.���+�t�3�3�3�3��Y�^�^�s�^�+�+�
��*�d�2�2�2�2�2�2r!c�R�|j�d��ddksJ�dS)Nr�r(rI)r=�find_previous_siblingrjs r�test_find_previous_siblingz.TestPreviousSibling.test_find_previous_sibling�s.���x�-�-�f�5�5�d�;�s�B�B�B�B�B�Br!c���|�|j�d��gd���|�|j�d���dg��dS)Nr�)rIrrHrHr')rr=�find_previous_siblingsrjs r�test_previous_siblingsz*TestPreviousSibling.test_previous_siblings�sf������� ?� ?�� G� G�-�o�o�	/�	/�	/�	
����� ?� ?�3� ?� G� G�#��O�O�O�O�Or!c�h�|�d��}|�d���}|jjdksJ�|jjdksJ�|�|�d��dg��|�d���dksJ�|�d���dksJ�dS)Nrprqr$rr?r>rr)rrryrcrNr�r�rss   r�&test_previous_sibling_for_text_elementz:TestPreviousSibling.test_previous_sibling_for_text_element�s����y�y�+�,�,���	�	��	�'�'���%�*�c�1�1�1�1��%�6�%�?�?�?�?����E�8�8��=�=��w�G�G�G��*�*�%�*�8�8�E�A�A�A�A��*�*�*�*�=�=��E�E�E�E�E�Er!)r6r7r8rkrzr|rr�r�r�r8r9s@rrvrv�s��������*�*�*�*�*�2�2�2�8�8�8�3�3�3�C�C�C�P�P�P�F�F�F�F�F�F�Fr!rvc��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d(�Z*d)�Z+d*�Z,d+�Z-d,�Z.d-�Z/d.S)/�TestTreeModificationc�v�|�d��}d|jd<|���|�d��ksJ�|jd=|���|�d��ksJ�d|jd<|���|�d��ksJ�dS)	Nz<a id="1"></a>r.r(z<a id="2"></a>rTrQ�id2z<a id2="foo"></a>)rr4r��document_forrs  r�test_attribute_modificationz0TestTreeModification.test_attribute_modification�s����y�y�)�*�*�����t���{�{�}�}�� 1� 1�2B� C� C�C�C�C�C��F�4�L��{�{�}�}�� 1� 1�)� <� <�<�<�<�<����u�
��{�{�}�}�� 1� 1�2E� F� F�F�F�F�F�F�Fr!c�d�tjd����}|�d|���}t||d��}t||d��}d|d<|j�d|��|j�d	|��|j���d
ksJ�dS)NrBz
<body></body>�r�r4�olzhttp://foo.com/�hrefrrs4<body><a href="http://foo.com/"></a><ol></ol></body>)r�lookuprrrQ�insertr�)rr�rr4r�s     r�test_new_tag_creationz*TestTreeModification.test_new_tag_creation�s���1�"�)�&�1�1�3�3���y�y��'�y�:�:����g�s�#�#��
��w��
%�
%��%��&�	��	����A�����	����B�����y���!�!�%\�\�\�\�\�\�\r!c�>�d}|�|��}|�d���}|j}|�d����|j��|j|ksJ�|���|�d��ksJ�dS)NzT<p id="1">Don't leave me <b>here</b>.</p>
                <p id="2">Don't leave!</p>rr'zD<p id="1">Don't leave me .</p>
<p id="2">Don't leave!<b>here</b></p>)rrrrUr�r�r�)r�docr�second_para�bolds     r�!test_append_to_contents_moves_tagz6TestTreeModification.test_append_to_contents_moves_tag�s���/���y�y��~�~���i�i�3�i�'�'���v��	
�	�	�S�	��� � ���(�(�(��{�k�)�)�)�)��{�{�}�}�� 1� 1�9�!
�!
�
�	
�	
�	
�	
�	
r!c��d}|�|��}|j}|�|j��}||ksJ�dS)Nz<a></a><b><c></c></b>)rr4�replace_withrw�rr*rr4�new_as     r�1test_replace_with_returns_thing_that_was_replacedzFTestTreeModification.test_replace_with_returns_thing_that_was_replaced�sF��&���y�y������F�����t�v�&�&���E�z�����r!c�z�d}|�|��}|j}|���}||ksJ�dS)N�<a><b></b><c></c></a>)rr4�unwrapr�s     r�+test_unwrap_returns_thing_that_was_replacedz@TestTreeModification.test_unwrap_returns_thing_that_was_replaced�s@��&���y�y������F�����
�
���E�z�����r!c��|�d��}|j}|���d|jksJ�t	jt��5|���ddd��n#1swxYwYt	jt��5|�|j	��ddd��dS#1swxYwYdS)Nz<a><b>Foo</b></a><c>Bar</c>)
rr4�extractr�r�r�r�r�r�rwr�s   r�Itest_replace_with_and_unwrap_give_useful_exception_when_tag_has_no_parentz^TestTreeModification.test_replace_with_and_unwrap_give_useful_exception_when_tag_has_no_parent�s5���y�y�6�7�7���F��	�	�	�����q�x�����
�]�:�
&�
&�	�	�
�H�H�J�J�J�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�
�]�:�
&�
&�	#�	#�
�N�N�4�6�"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	#�	#s$�A8�8A<�?A<�C�C�Cc���d}|�|��}|j}|j�|��|���|�|��ksJ�dS)Nz-<a><b></b><c>Foo<d></d></c></a><a><e></e></a>)rrwr�r�r�)rr*rrws    r�test_replace_tag_with_itselfz1TestTreeModification.test_replace_tag_with_itselfs`��>���y�y������F������A�����{�{�}�}�� 1� 1�$� 7� 7�7�7�7�7�7�7r!c���d}|�|��}tjt��5|j�|j��ddd��dS#1swxYwYdS�N�<a><b></b></a>)rr�r�r�rr�r4�rr*rs   r�1test_replace_tag_with_its_parent_raises_exceptionzFTestTreeModification.test_replace_tag_with_its_parent_raises_exceptions������y�y�����
�]�:�
&�
&�	(�	(��F�����'�'�'�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(�	(�	(s� A�A"�%A"c���d}|�|��}tjt��5|j�d|j��ddd��dS#1swxYwYdS)Nr�r)rr�r�r�r4r�r�s   r�,test_insert_tag_into_itself_raises_exceptionzATestTreeModification.test_insert_tag_into_itself_raises_exceptions������y�y�����
�]�:�
&�
&�	%�	%��F�M�M�!�T�V�$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�	%�	%s�!A�A#�&A#c�f�|�d��}d}|�|��}|�d|��|jD]}t|t��rJ��t|j��\}}}}d|jksJ�d|jksJ�d|jksJ�d|jksJ�dS)	z�Inserting one BeautifulSoup object into another actually inserts all
        of its children -- you'll never combine BeautifulSoup objects.
        z-<p>And now, a word:</p><p>And we're back.</p>z<p>p2</p><p>p3</p>rzAnd now, a word:�p2�p3zAnd we're back.N)rr��descendants�
isinstancer�list�childrenr)	rrr*�	to_insertr��p1r�r��p4s	         r�1test_insert_beautifulsoup_object_inserts_childrenzFTestTreeModification.test_insert_beautifulsoup_object_inserts_childrens����y�y�H�I�I��#���I�I�d�O�O�	����A�y�!�!�!��!�	4�	4�A�!�!�]�3�3�3�3�3�3��d�m�,�,���B��B�!�R�Y�.�.�.�.��r�y� � � � ��r�y� � � � � �B�I�-�-�-�-�-�-r!c��|�d��}|j}|jd}|�dd��|j\}}|�d��|�d��d|jjksJ�dS)Nz<p><a>one</a><b>three</b></p>rr�tworY�three)rr4r�r��replaceWithrr)rrr4r�left�rights      r�3test_replace_with_maintains_next_element_throughoutzHTestTreeModification.test_replace_with_maintains_next_element_throughout/s����y�y�8�9�9���F��
�J�q�M��	����E�����j���e��������
���"�����$�&�-�'�'�'�'�'�'r!c�.�|�d��}|�d����d��|�d���}|j}|j|ksJ�|j|ksJ�|jj|ksJ�|jdksJ�dS)Nz<b>Argh!</b>�Argh!r$�Hooray!)rrr�rr?r�r)rr�new_textrs    r�test_replace_final_nodez,TestTreeModification.test_replace_final_node>s����y�y��(�(���	�	��	�!�!�.�.�y�9�9�9��9�9�I�9�.�.���F���(�A�-�-�-�-���!�#�#�#�#��(�5��A�A�A�A��$��,�,�,�,�,�,r!c��|�d��}|j�dd��|���|�d��ksJ�|�d���}|jdksJ�|jj|ksJ�|jdksJ�|jj	|ksJ�|j	dksJ�|j|j
ksJ�dS)Nz<a><b>Argh!</b><c></c></a>rr�z!<a><b>Argh!Hooray!</b><c></c></a>r$r�)rrr�r�r�rr?rryr`rw)rrr�s   r�test_consecutive_text_nodesz0TestTreeModification.test_consecutive_text_nodesHs����y�y�5�6�6����
�
�a��#�#�#��{�{�}�}�� 1� 1�/�!
�!
�
�	
�	
�	
��9�9�I�9�.�.���(�G�3�3�3�3��(�5��A�A�A�A��(�G�3�3�3�3��(�5��A�A�A�A��$��,�,�,�,��$���.�.�.�.�.�.r!c��|�d��}|j�dd��|j�dd��ddg|jjksJ�|jjdjdksJ�dS)NrTrr>rQ)rr4r�r�rrs  r�test_insert_stringz'TestTreeModification.test_insert_string]s{���y�y��#�#����
�
�a�������
�
�a������u�~����0�0�0�0��v��q�!�.�%�7�7�7�7�7�7r!c��|���}|�d|���}t||d��}|�dd��|j�d|��|���|�d��ksJ�|j}|j|ksJ�|j	|ksJ�|�
d�	��}|j|ksJ�|j|ksJ�|j
}|j|ksJ�|j	|ksJ�|�
d�	��}|j|ksJ�|j|ksJ�|j|ksJ�dS)
Nz%<a><b>Find</b><c>lady!</c><d></d></a>r��magictagr�therz=<a><b>Find</b><magictag>the</magictag><c>lady!</c><d></d></a>�Findr$)r�rrr�r4r�r�rr`ryrrr?rwr�)rr�r�	magic_tag�b_tagr�c_tagr�s        r�test_insert_tagz$TestTreeModification.test_insert_tagfs����&�&�(�(���y�y�3�W��F�F����g�z�2�2�	�����E�"�"�"���
�
�a��#�#�#��{�{�}�}�� 1� 1�O�!
�!
�
�	
�	
�	
�
����!�Y�.�.�.�.��)�U�2�2�2�2��z�z��z�(�(��� �I�-�-�-�-��)�T�1�1�1�1�����%��.�.�.�.��%��2�2�2�2��n�n�E�n�*�*���z�Y�&�&�&�&���5�(�(�(�(��%��,�,�,�,�,�,r!c��d}|�|��}|j�|j��||���ksJ�dSr�)rr4rUrr��rr�rs   r�*test_append_child_thats_already_at_the_endz?TestTreeModification.test_append_child_thats_already_at_the_end�sK�����y�y�������
�
�d�f�����t�{�{�}�}�$�$�$�$�$�$r!c���d}|�|��}|j|j|j|j|j|jg}|j�|��d|�	��ksJ�dS)Nz1<a><b><c><d><e><f><g></g></f></e></d></c></b></a>z1<a><g></g><f></f><e></e><d></d><c></c><b></b></a>)
r�gr��er�rwrr4�extendr�)rr�rrVs    r�test_extendz TestTreeModification.test_extend�sg��B���y�y�����
�V�T�V�T�V�T�V�T�V�T�V�<����
�
�a����B�d�k�k�m�m�S�S�S�S�S�Sr!c�"�d}|�|��}|�dd���}|�dd���}|�|��d|���ksJ�d|���ksJ�dS)NzS<body><div id="d1"><a>1</a><a>2</a><a>3</a><a>4</a></div><div id="d2"></div></body>r��d1r'�d2z<div id="d1"></div>z3<div id="d2"><a>1</a><a>2</a><a>3</a><a>4</a></div>)rrr�r�)rr�rr�r�s     r�&test_extend_with_another_tags_contentsz;TestTreeModification.test_extend_with_another_tags_contents�s���d���y�y�����
�Y�Y�u��Y�
&�
&��
�Y�Y�u��Y�
&�
&��
�	�	�"�
�
�
�$��	�	���3�3�3�3�D��	�	���S�S�S�S�S�Sr!c��d}|�|��}|j�d|j��d|���ksJ�dS)Nz<a><b></b><c></c><d></d></a>rz<a><d></d><b></b><c></c></a>)rr4r�r�r�r�s   r�$test_move_tag_to_beginning_of_parentz9TestTreeModification.test_move_tag_to_beginning_of_parent�sM��-���y�y�������
�
�a��� � � �-������>�>�>�>�>�>r!c��|�d��}|j�dd��t|j��dksJ�dS)Nz<br/>r�Contentsz<br>Contents</br>)r�brr�r)rs  r�&test_insert_works_on_empty_element_tagz;TestTreeModification.test_insert_works_on_empty_element_tag�sK��
�y�y��!�!������q�*�%�%�%��4�7�|�|�2�2�2�2�2�2�2r!c�\�|�d��}|j�d��|j�d��|���|�d��ksJ�|j�|j��|���|�d��ksJ�|j}t
jt��5|�|��ddd��n#1swxYwY|�	��t
jt��5|�d��ddd��n#1swxYwY|�d��}|j�|�
d����dS)	Nr-�BAZ�QUUXzQUUX<a>foo</a>BAZ<b>bar</b>�QUUX<b>bar</b><a>foo</a>BAZ�nope�<a>r4)rr�
insert_beforer4r�r�r�r�r�r��new_tag�rrrs   r�test_insert_beforez'TestTreeModification.test_insert_before�s����y�y�/�0�0������U�#�#�#�����V�$�$�$��{�{�}�}�� 1� 1�)�!
�!
�
�	
�	
�	
�	
����T�V�$�$�$��{�{�}�}�� 1� 1�2O� P� P�P�P�P�P�
�F��
�]�:�
&�
&�	�	�
�O�O�A����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	
�	�	����
�]�:�
&�
&�	$�	$�
�O�O�F�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$��y�y���������T�\�\�#�.�.�/�/�/�/�/�$�#D�D	�D	�=E�E#�&E#c��|�d��}|j�ddd��|j�ddd��|���|�d��ksJ�|j�|jd��|���|�d��ksJ�dS)Nr-r�� r�z$QUUX BAZ<a>foo</a>BAZ QUUX<b>bar</b>�FOOz'QUUX BAZ<b>bar</b>FOO<a>foo</a>BAZ QUUX)rrr�r4r�r�rs  r�test_insert_multiple_beforez0TestTreeModification.test_insert_multiple_before�s����y�y�/�0�0������U�C��0�0�0�����V�S�%�0�0�0��{�{�}�}�� 1� 1�2�!
�!
�
�	
�	
�	
�	
����T�V�U�+�+�+��{�{�}�}�� 1� 1�5�!
�!
�
�	
�	
�	
�	
�	
r!c�\�|�d��}|j�d��|j�d��|���|�d��ksJ�|j�|j��|���|�d��ksJ�|j}t
jt��5|�|��ddd��n#1swxYwY|�	��t
jt��5|�d��ddd��n#1swxYwY|�d��}|j�
|�d����dS)	Nr-r�r�z<a>foo</a>QUUX<b>bar</b>BAZr�r�r�r4)rr�insert_afterr4r�r�r�r�r�r�r�r�r�s   r�test_insert_afterz&TestTreeModification.test_insert_after�s����y�y�/�0�0������E�"�"�"�����F�#�#�#��{�{�}�}�� 1� 1�)�!
�!
�
�	
�	
�	
�	
����D�F�#�#�#��{�{�}�}�� 1� 1�2O� P� P�P�P�P�P�
�F��
�]�:�
&�
&�	�	�
�N�N�1����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	
�	�	����
�]�:�
&�
&�	#�	#�
�N�N�6�"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#��y�y���������T�\�\�#�.�.�/�/�/�/�/r�c��|�d��}|j�ddd��|j�ddd��|���|�d��ksJ�|j�|jd��|���|�d��ksJ�dS)Nr-r�r�r�z$<a>foo</a>QUUX BAZ<b>bar</b>BAZ QUUXzFOO z(QUUX BAZ<b>bar</b><a>foo</a>FOO BAZ QUUX)rrr�r4r�r�rs  r�test_insert_multiple_afterz/TestTreeModification.test_insert_multiple_after�s����y�y�/�0�0������E�3��/�/�/�����F�C��/�/�/��{�{�}�}�� 1� 1�2�!
�!
�
�	
�	
�	
�	
����D�F�F�+�+�+��{�{�}�}�� 1� 1�6�!
�!
�
�	
�	
�	
�	
�	
r!c�*�|�d��}|�d��}|�d��}tjt
��5|�|��ddd��n#1swxYwYtjt��5|�|��ddd��n#1swxYwYtjt
��5|�|��ddd��dS#1swxYwYdS�NrYr4)rr��
new_stringr�r�r�r��NotImplementedError�rrrsrs    r�:test_insert_after_raises_exception_if_after_has_no_meaningzOTestTreeModification.test_insert_after_raises_exception_if_after_has_no_meaning�s����y�y��}�}���l�l�3��������$�$��
�]�:�
&�
&�	%�	%�����$�$�$�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%�	%����	%�	%�	%�	%�
�]�.�
/�
/�	#�	#����c�"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�
�]�:�
&�
&�	"�	"����S�!�!�!�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"�	"�	"�6�A;�;A?�A?�C�C�C�%D�D�Dc�*�|�d��}|�d��}|�d��}tjt
��5|�|��ddd��n#1swxYwYtjt��5|�|��ddd��n#1swxYwYtjt
��5|�|��ddd��dS#1swxYwYdSr�)rr�r�r�r�r�r�r�r�s    r�Ftest_insert_before_raises_notimplementederror_if_before_has_no_meaningz[TestTreeModification.test_insert_before_raises_notimplementederror_if_before_has_no_meanings����y�y��}�}���l�l�3��������$�$��
�]�:�
&�
&�	&�	&�� � ��%�%�%�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&�
�]�.�
/�
/�	$�	$����s�#�#�#�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$�	$����	$�	$�	$�	$�
�]�:�
&�
&�	#�	#����c�"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�	#�	#r�c�V�|�d��}|�d��\}}|�|��|���|�d��ksJ�|jdksJ�|j|jksJ�|jdksJ�|jdksJ�dS)Nz;<p>There's <b>no</b> business like <b>show</b> business</p>rz0<p>There's  business like <b>no</b> business</p>�noz	 business)	rr1r�r�r�r��prr`)rrr�shows    r�test_replace_withz&TestTreeModification.test_replace_with
s����y�y�M�O�O���=�=��%�%���D����"�����{�{�}�}�� 1� 1�>�!
�!
�
�	
�	
�	
��{�d�"�"�"�"��y�D�F�"�"�"�"���$�&�&�&�&���+�-�-�-�-�-�-r!c��td���}tjt��5|�d��ddd��n#1swxYwY|�d��j}tjt��5|j�|��ddd��n#1swxYwYtjt��5|j�d|d��ddd��dS#1swxYwYdS)Nr4r�z
won't workr��string1�string2)rr�r�r�r�rr4r)r�a_tags  r�test_replace_with_errorsz-TestTreeModification.test_replace_with_errorss�����
�
�
��
�]�:�
&�
&�	-�	-����|�,�,�,�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-��	�	�*�+�+�-��
�]�:�
&�
&�	(�	(��G� � ��'�'�'�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(��]�:�
&�
&�	>�	>��G� � ��E�9�=�=�=�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>�	>����	>�	>�	>�	>�	>�	>s5�A�A�A�
B1�1B5�8B5�C?�?D�Dc���d}|�|��}|�d��}d|_|�d��}|�d��}d}|j�||||��|���dksJ�|jj|ksJ�|jj|ksJ�|jj|ksJ�|jj|ksJ�dS)Nr�r�z
Text In D Tagr�r�zRandom Textz;<a><b></b><d>Text In D Tag</d><e></e>Random Text<f></f></a>)rr�rrwr�r�rr)rr�r�d_tag�e_tag�f_tag�a_strings       r�test_replace_with_multiplez/TestTreeModification.test_replace_with_multiple*s���&���y�y��������S�!�!��&������S�!�!�����S�!�!�� ������E�5�(�E�:�:�:��{�{�}�}� ]�]�]�]�]��v�"�e�+�+�+�+��|�(�%�/�/�/�/��!�(�H�4�4�4�4��!�.�%�7�7�7�7�7�7r!c��d}|�|��}|j�|j��d|���ksJ�dS)Nr�z<a><c></c></a>)rrr�rwr�r�s   r�test_replace_first_childz-TestTreeModification.test_replace_first_child9�M��&���y�y���������D�F�#�#�#��4�;�;�=�=�0�0�0�0�0�0r!c��d}|�|��}|j�|j��d|���ksJ�dS)Nr�r�)rrwr�rr�r�s   r�test_replace_last_childz,TestTreeModification.test_replace_last_child?rr!c��|�d��}|j}|j}|�|��|���|�d��ksJ�|jdksJ�|�d���jdksJ�|j	dksJ�|j
dksJ�|jdksJ�|j|jksJ�|j	dksJ�|jj|j
ksJ�|j
dksJ�|�d���}|j}|j|ksJ�|j
|ksJ�|j	|ksJ�|j|ksJ�dS)NzQ<a>We<b>reserve<c>the</c><d>right</d></b></a><e>to<f>refuse</f><g>service</g></e>z-<a>We<f>refuse</f></a><e>to<g>service</g></e>r�r$�We�to)rrr�r�r�r�r�rrr?r`ryr4r�r�)rr�
remove_tag�move_tag�to_text�g_tags      r�test_nested_tag_replace_withz1TestTreeModification.test_nested_tag_replace_withEs����y�y�c�e�e��
�V�
��6������)�)�)��{�{�}�}�� 1� 1�;�!
�!
�
�	
�	
�	
�
� �D�(�(�(�(����g��.�.�;�t�C�C�C�C��*�d�2�2�2�2��&�$�.�.�.�.��*�d�2�2�2�2���$�&�(�(�(�(��(�D�0�0�0�0��$�1�T�V�;�;�;�;��$��,�,�,�,��)�)�4�)�(�(������#�u�,�,�,�,��#�u�,�,�,�,��%��0�0�0�0��%��0�0�0�0�0�0r!c��|�d��}|j���|jdksJ�|jjdksJ�dS)NzI
            <p>Unneeded <em>formatting</em> is unneeded</p>
            zUnneeded formatting is unneeded)r�emr�rr*r�s  r�test_unwrapz TestTreeModification.test_unwrapis\���y�y�����	
��������w�$������v�{�?�?�?�?�?�?�?r!c��|�d��}|j�|�d����}|���dksJ�|���|�d��ksJ�dS)NzI wish I was bold.r�<b>I wish I was bold.</b>)rr�wrapr�r�r�)rrr�s   r�	test_wrapzTestTreeModification.test_wrapqs}���y�y�-�.�.���� � ����c�!2�!2�3�3���|�|�~�~�!<�<�<�<�<��{�{�}�}�� 1� 1�2M� N� N�N�N�N�N�N�Nr!c���|�d��}|jj�|j��|���|�d��ksJ�dS)Nz<b></b>I wish I was bold.r")rrr`r#r�r�rs  r�%test_wrap_extracts_tag_from_elsewherez:TestTreeModification.test_wrap_extracts_tag_from_elsewherews]���y�y�4�5�5����� � ���(�(�(��{�{�}�}�� 1� 1�2M� N� N�N�N�N�N�N�Nr!c��|�d��}|jj�|j��dt	|jj��ksJ�|���|�d��ksJ�dS)Nz+<b>I like being bold.</b>I wish I was bold.r.z+<b>I like being bold.I wish I was bold.</b>)rrr`r#r0r�r�r�rs  r�&test_wrap_puts_new_contents_at_the_endz;TestTreeModification.test_wrap_puts_new_contents_at_the_end|s����y�y�F�G�G����� � ���(�(�(��C����(�(�(�(�(�(��{�{�}�}�� 1� 1�9�!
�!
�
�	
�	
�	
�	
�	
r!c�|�|�d��}t|jj��dksJ�|�d������}|���dksJ�|���dksJ�t|jj��dksJ�|jdksJ�|jdksJ�|j	j	dksJ�|�d�	��}|�d
�	��}|j	|ksJ�|j
|ksJ�|j|ksJ�|j|ksJ�dS)NzR<html><body>Some content. <div id="nav">Nav crap</div> More content.</body></html>rE�navr'z6<html><body>Some content.  More content.</body></html>z<div id="nav">Nav crap</div>r.zSome content. r$z More content.)rr0rQr�rr�r�r�r?rr`ry)rr�	extracted�	content_1�	content_2s     r�test_extractz!TestTreeModification.test_extract�sp���y�y�`�b�b���4�9�%�&�&�!�+�+�+�+��I�I��I�'�'�/�/�1�1�	��{�{�}�}� X�X�X�X�X����!�!�%C�C�C�C�C��4�9�%�&�&�!�+�+�+�+���4�'�'�'�'��)�T�1�1�1�1��%�2�d�:�:�:�:��I�I�%5�I�6�6�	��I�I�%5�I�6�6�	��%��2�2�2�2��%��2�2�2�2��)�Y�6�6�6�6��)�Y�6�6�6�6�6�6r!c��|�d��}|jj}|jj}|�d��}|�d��}|j�|��|j�|��|���|���||jjksJ�||jjksJ�dS)Nr-rQr>)rr4rrr�rUr�)rr�foo_1�bar_1�foo_2�bar_2s      r�4test_extract_distinguishes_between_identical_stringszITestTreeModification.test_extract_distinguishes_between_identical_strings�s����y�y�/�0�0����
����
������&�&������&�&����
�
�e������
�
�e����
	�
�
����
�
�
�������
�%�%�%�%����
�%�%�%�%�%�%r!c���|�d����fd���d��D��dt�j��ksJ�dS)Nzv
<html>
<head>
<script>foo</script>
</head>
<body>
 <script>bar</script>
 <a></a>
</body>
<script>baz</script>
</html>c�B��g|]}�j�����Sr:)�scriptr�)rr�rs  �rrzKTestTreeModification.test_extract_multiples_of_same_tag.<locals>.<listcomp>�s'���@�@�@�1���	�	�	�	�@�@�@r!r7z<body>

<a></a>
</body>)rr1r)rQrs @r�"test_extract_multiples_of_same_tagz7TestTreeModification.test_extract_multiples_of_same_tag�sc����y�y�
�
�
��	A�@�@�@��
�
�h�(?�(?�@�@�@�@�+�s�4�9�~�~�=�=�=�=�=�=r!c��|�d��}|�d�����d|�d��ksJ�dS)Nz<html>
<body>hi</body>
</html>rQ)rrr�rs  r�Btest_extract_works_when_element_is_surrounded_by_identical_stringszWTestTreeModification.test_extract_works_when_element_is_surrounded_by_identical_strings�s]���y�y�����	
�	�	�&���!�!�#�#�#��t�y�y��(�(�(�(�(�(�(�(r!c�@�|�d��}|j}|j���t	|jj��dksJ�t
|d��sJ�|j}|�d���dt	|j��ksJ�dS)zTag.clear()z4<p><a>String <em>Italicized</em></a> and another</p>rr�T)�	decomposeN)rr4r�clearr0r�rZr)rrr4rs    r�
test_clearzTestTreeModification.test_clear�s����y�y�O�P�P���F����������4�6�?�#�#�q�(�(�(�(��q�*�%�%�%�%�%��T��	���$������C���$�$�$�$�$�$�$�$r!c��|�d��}|�d��\}}|j}|jj}||||fD]}d|jksJ��|���|||fD]}d|jksJ��d|jksJ�dS)Nz;<p><a>String <em>Italicized</em></a></p><p>Another para</p>rFT)rr1r4rr�
decomposedr<)rrr�r�r4r*r�s       r�test_decomposez#TestTreeModification.test_decompose�s����y�y�V�W�W�����s�#�#���B��D���u�|���b�!�T�"�	)�	)�A��A�L�(�(�(�(�(�	�������a���	(�	(�A��1�<�'�'�'�'�'���
�%�%�%�%�%�%r!c��|�d��}d|j_|jjdgksJ�d|j_|jjdgksJ�dS)zTag.string = 'string'z<a></a> <b><c></c></b>rQr>N)rr4rr�rrs  r�test_string_setz$TestTreeModification.test_string_set�sZ���y�y�1�2�2�����
��v��5�'�)�)�)�)����
��v��5�'�)�)�)�)�)�)r!c��|�d��}|jj|j_|j���dksJ�dS)Nz<a><b>foo</b><c>bar</c>s<a><b>bar</b><c>bar</c></a>)rrwrrr4r�rs  r�/test_string_set_does_not_affect_original_stringzDTestTreeModification.test_string_set_does_not_affect_original_string�sC���y�y�2�3�3����
���
��v�}�}���"@�@�@�@�@�@�@r!c��|�d��}td��}||j_t	|jjt��sJ�dS)NrTrQ)rrr4rr�)rr�cdatas   r�)test_set_string_preserves_class_of_stringz>TestTreeModification.test_set_string_preserves_class_of_string�sG���y�y��#�#���e�������
��$�&�-��/�/�/�/�/�/�/r!N)0r6r7r8r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr
rrrrr r$r&r(r.r4r8r:r>rArCrErHr:r!rr�r��s�������G�G�G�]�]�]�
�
�
�$������#�#�#�8�8�8�(�(�(�%�%�%�.�.�.�(
(�
(�
(�-�-�-�/�/�/�*8�8�8�-�-�-�<%�%�%�T�T�T�T�T�T�?�?�?�3�3�3�0�0�0�6
�
�
�0�0�0�4

�

�

�	"�	"�	"�	#�	#�	#�.�.�.�
>�
>�
>�
8�
8�
8�1�1�1�1�1�1�"1�"1�"1�H@�@�@�O�O�O�O�O�O�

�
�
�7�7�7�0&�&�&�"
>�
>�
>� )�)�)�%�%�%�&�&�&� *�*�*�A�A�A�
0�0�0�0�0r!r�c��eZdZd�Zd�ZdS)�TestDeprecatedArgumentsc�6�|�d��}tjd���5}|�d���\}|dksJ�|jjdksJ�t
|dj��}|dksJ�	ddd��dS#1swxYwYdS)	Nz<a>some</a><b>markup</b>T��recordr[�r*rrzOThe 'text' argument to find()-type methods is deprecated. Use 'string' instead.)r�warnings�catch_warningsr1r�rcr)�message)rr�wr[�msgs     r�test_find_type_method_stringz4TestDeprecatedArguments.test_find_type_method_string�s���y�y�3�4�4��
�
$�D�
1�
1�
1�	l�Q��}�}�(�}�3�3�H�V��X�%�%�%�%��=�%��,�,�,�,��a��d�l�#�#�C��k�k�k�k�k�k�	l�	l�	l�	l�	l�	l�	l�	l�	l�	l�	l�	l����	l�	l�	l�	l�	l�	ls�AB�B�Bc���tjd���5}td���}|jdksJ�t	|dj��}|dksJ�	ddd��dS#1swxYwYdS)NTrLr*rNrzXThe 'text' argument to the SoupStrainer constructor is deprecated. Use 'string' instead.)rOrPrr*r)rQ)rrRr�rSs    r�$test_soupstrainer_constructor_stringz<TestDeprecatedArguments.test_soupstrainer_constructor_strings���
�
$�D�
1�
1�
1�	u�Q�#��0�0�0�H��=�F�*�*�*�*��a��d�l�#�#�C��t�t�t�t�t�t�		u�	u�	u�	u�	u�	u�	u�	u�	u�	u�	u�	u����	u�	u�	u�	u�	u�	us�AA$�$A(�+A(N)r6r7r8rTrVr:r!rrJrJ�s:������l�l�l�u�u�u�u�ur!rJ)*r9�pdbrr�rArO�bs4r�bs4.builderrr�bs4.elementrrr	r
rrr
rrrrrYrrrr<r^rfr�r�r�r�rrr;rWr]rvr�rJr:r!r�<module>r[s����������
�
�
�
�	�	�	�	�����������������������������������������������������
,�,�,�,�,�x�,�,�,�>6)�6)�6)�6)�6)�(�6)�6)�6)�rD�D�D�D�D��D�D�D�K �K �K �K �K ��K �K �K �\q7�q7�q7�q7�q7�X�q7�q7�q7�h).�).�).�).�).��).�).�).�X���������&/6�/6�/6�/6�/6�8�/6�/6�/6�dw�w�w�w�w�H�w�w�w�&#�&#�&#�&#�&#��&#�&#�&#�P.#�.#�.#�.#�.#�]�.#�.#�.#�b&�&�&�&�&�(�&�&�&�**B�*B�*B�*B�*B�k�*B�*B�*B�Z*F�*F�*F�*F�*F�+�*F�*F�*F�Zm0�m0�m0�m0�m0�8�m0�m0�m0�`u�u�u�u�u�h�u�u�u�u�ur!