
    (ph                         S r SSKrSSKJrJrJrJrJrJr   " S S5      r	 " S S5      r
 " S S	5      r " S
 S5      rg)zTests of classes in element.py.

The really big classes -- Tag, PageElement, and NavigableString --
are tested in separate files.
    N)HTMLAttributeDictXMLAttributeDictCharsetMetaAttributeValueContentMetaAttributeValueNamespacedAttribute	ResultSetc                   ,    \ rS rSrS rS rS rS rSrg)TestNamedspacedAttribute   c                 z    [        SS 5      nUS:X  d   e[        SS5      nUS:X  d   e[        S5      nUS:X  d   eg )Nxmlns r   selfas     I/var/www/html/venv/lib/python3.13/site-packages/bs4/tests/test_element.py test_name_may_be_none_or_missing9TestNamedspacedAttribute.test_name_may_be_none_or_missing   sH    .G||,G||(G||    c                 T    [        S S5      nUS:X  d   e[        SS5      nUS:X  d   eg )Ntagr   r   r   s     r   %test_namespace_may_be_none_or_missing>TestNamedspacedAttribute.test_namespace_may_be_none_or_missing   s2    e,EzzE*Ezzr   c                 ,    [        SS5      nSU:X  d   eg )Nr   bza:br   r   s     r   6test_attribute_is_equivalent_to_colon_separated_stringOTestNamedspacedAttribute.test_attribute_is_equivalent_to_colon_separated_string#   s    S)zzr   c                     [        SSS5      n[        SSS5      nX:X  d   e[        SSS 5      nX:X  d   e[        SSS5      nX:w  d   e[        SSS5      nX:w  d   eg )Nr   r   czr   )r   r   r   r    des         r   ;test_attributes_are_equivalent_if_prefix_and_name_identicalTTestNamedspacedAttribute.test_attributes_are_equivalent_if_prefix_and_name_identical'   sp    S#.S#.vv  S$/vv  S#.vvS#.vvr    N)	__name__
__module____qualname____firstlineno__r   r   r   r$   __static_attributes__r&   r   r   r
   r
      s    r   r
   c                   $    \ rS rSrSrS rS rSrg))TestAttributeValueWithCharsetSubstitution8   zhCertain attributes are designed to have the charset of the
final document substituted into their value.
c                     [        S5      nSU:X  d   eSUR                  :X  d   eSUR                  S5      :X  d   eSUR                  S5      :X  d   eSUR                  S5      :X  d   eg )Nzeuc-jputf8asciir   palmos)r   original_valuesubstitute_encodingr   values     r   !test_charset_meta_attribute_valueKTestAttributeValueWithCharsetSubstitution.test_charset_meta_attribute_value=   s}     *(35   5/////226::::%33G<<<< U..x8888r   c                     [        S5      nSU:X  d   eSUR                  :X  d   eSUR                  S5      :X  d   eSUR                  S5      :X  d   eSUR                  S5      :X  d   eg )Nztext/html; charset=euc-jpztext/html; charset=utf8r0   ztext/html; charset=asciir1   z	text/htmlr2   )r   r3   r4   r5   s     r   !test_content_meta_attribute_valueKTestAttributeValueWithCharsetSubstitution.test_content_meta_attribute_valueJ   s|    )*EF*e333*e.B.BBBB(E,E,Ef,MMMM)U-F-Fw-OOOO e77AAAAr   r&   N)r'   r(   r)   r*   __doc__r7   r:   r+   r&   r   r   r-   r-   8   s    9	Br   r-   c                        \ rS rSrS rS rSrg)TestAttributeDictsV   c                     [        5       nSUS'   US   S:X  d   eSUS'   US   S:X  d   eSUS'   US   SL d   eSUS'   US   SL d   eS US'   US   S:X  d   eg )	Nd   v100Zd;Y@100.123FTr   )r   )r   r"   s     r   !test_xml_attribute_value_handling4TestAttributeDicts.test_xml_attribute_value_handlingW   s     #v#v""" #v#v~~#v||r   c                     [        5       nSUS'   US   S:X  d   eSUS'   US   S:X  d   eSUS'   SU;  d   eS US'   SU;  d   eSUS'   US   S:X  d   e[        SS	S
5      nSX'   X   S	:X  d   eg )NrA   rB   rC   rD   rE   FTprefixname	namespace)r   r   )r   r"   	attributes      r   "test_html_attribute_value_handling5TestAttributeDicts.test_html_attribute_value_handlingk   s     #v#v"""#!||#!||#v}}'&+F	|v%%%r   r&   N)r'   r(   r)   r*   rF   rM   r+   r&   r   r   r>   r>   V   s    (&r   r>   c                       \ rS rSrS rSrg)TestResultSet   c                     [        S 5      n[        R                  " [        5       nUR                    S S S 5        S[        WR                  5      :X  d   eg ! , (       d  f       N*= f)NzResultSet object has no attribute "name". You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?)r   pytestraisesAttributeErrorrJ   strr6   )r   rsr#   s      r   test_getattr_exception$TestResultSet.test_getattr_exception   sN    t_]]>*aGG + v177|	
 +*s   A
A%r&   N)r'   r(   r)   r*   rX   r+   r&   r   r   rP   rP      s    
r   rP   )r<   rS   bs4.elementr   r   r   r   r   r   r
   r-   r>   rP   r&   r   r   <module>r[      sE     $ $NB B<)& )&X
 
r   