← Back
Editing: test_pageelement.cpython-311.pyc
� H�cim � � � d Z ddlZddlZddlZddlmZ ddlmZmZ ddl m Z mZ erddlm Z G d� d e � � Z G d � de � � Zej � e d� � � G d� de � � � � Z G d� de � � ZdS )z*Tests of the bs4.element.PageElement class� N)� BeautifulSoup)�Comment�SoupStrainer� )�SoupTest�SOUP_SIEVE_PRESENT)�SelectorSyntaxErrorc �B � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd S )�TestEncodingz0Test the ability to encode objects into strings.c � � d}| � |� � }|j j � d� � d� d� � k sJ �d S )N� <b>☃</b>�utf-8� ☃)�soup�b�string�encode��self�htmlr s �</usr/lib/python3/dist-packages/bs4/tests/test_pageelement.py�"test_unicode_string_can_be_encodedz/TestEncoding.test_unicode_string_can_be_encoded sM � �#���y�y������v�}�#�#�G�,�,� �0D�0D�W�0M�0M�M�M�M�M�M�M� c � � d}| � |� � }|j � d� � |� d� � k sJ �d S )Nr r �r r r r s r �1test_tag_containing_unicode_string_can_be_encodedz>TestEncoding.test_tag_containing_unicode_string_can_be_encoded sG � �#���y�y������v�}�}�W�%�%����W�)=�)=�=�=�=�=�=�=r c �t � d}| � |� � }|j � d� � dk sJ �d S )Nr �asciis <b>☃</b>r r s r �<test_encoding_substitutes_unrecognized_characters_by_defaultzITestEncoding.test_encoding_substitutes_unrecognized_characters_by_default s<