U
    lufI	  ã                   @   sH   d Z ddlmZmZmZ ddlmZ G dd„ deƒZG dd„ deƒZ	d	S )
z‚Tests of classes in element.py.

The really big classes -- Tag, PageElement, and NavigableString --
are tested in separate files.
é    )ÚCharsetMetaAttributeValueÚContentMetaAttributeValueÚNamespacedAttributeé   )ÚSoupTestc                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚTestNamedspacedAttributec                 C   sD   t dd ƒ}|dkst‚t ddƒ}|dks,t‚t dƒ}|dks@t‚d S )NÚxmlnsÚ ©r   ÚAssertionError©ÚselfÚa© r   ú:/tmp/pip-unpacked-wheel-pg4vfqbd/bs4/tests/test_element.pyÚ test_name_may_be_none_or_missing   s    

z9TestNamedspacedAttribute.test_name_may_be_none_or_missingc                 C   s0   t d dƒ}|dkst‚t ddƒ}|dks,t‚d S )NÚtagr	   r
   r   r   r   r   Ú%test_namespace_may_be_none_or_missing   s    

z>TestNamedspacedAttribute.test_namespace_may_be_none_or_missingc                 C   s   t ddƒ}d|kst‚d S )Nr   Úbza:br
   r   r   r   r   Ú6test_attribute_is_equivalent_to_colon_separated_string"   s    
zOTestNamedspacedAttribute.test_attribute_is_equivalent_to_colon_separated_stringc                 C   sp   t dddƒ}t dddƒ}||ks$t‚t ddd ƒ}||ks<t‚t dddƒ}||ksTt‚t dddƒ}||kslt‚d S )Nr   r   ÚcÚzr
   )r   r   r   r   ÚdÚer   r   r   Ú;test_attributes_are_equivalent_if_prefix_and_name_identical&   s    zTTestNamedspacedAttribute.test_attributes_are_equivalent_if_prefix_and_name_identicalN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r      s   
r   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )Ú)TestAttributeValueWithCharsetSubstitutionzpCertain attributes are designed to have the charset of the
    final document substituted into their value.
    c                 C   sJ   t dƒ}d|kst‚d|jks"t‚d| d¡ks4t‚d| d¡ksFt‚d S )Nzeuc-jpÚutf8Úascii)r   r   Úoriginal_valueÚencode©r   Úvaluer   r   r   Ú!test_content_meta_attribute_value<   s
    zKTestAttributeValueWithCharsetSubstitution.test_content_meta_attribute_valuec                 C   sJ   t dƒ}d|kst‚d|jks"t‚d| d¡ks4t‚d| d¡ksFt‚d S )Nztext/html; charset=euc-jpztext/html; charset=utf8r   ztext/html; charset=asciir    )r   r   r!   r"   r#   r   r   r   r%   E   s
    N)r   r   r   Ú__doc__r%   r   r   r   r   r   7   s   	r   N)
r&   Zbs4.elementr   r   r   r	   r   Úobjectr   r   r   r   r   r   Ú<module>   s   (