| 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 : |
�
V �gC? � � � d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z m
Z
ddlmZ ddl
mZ G d� d e� Z G d
� de� Z G d� d
e� Z G d� de� Zy)z*Tests of the bs4.element.PageElement class� N)�
BeautifulSoup)�AttributeValueList�Comment)�SoupStrainer� )�SoupTestc �F � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Zd
� Zy)�TestEncodingz0Test the ability to encode objects into strings.c � � d}| j |� }|j j j d� dj d� k( sJ �y )N�
<b>☃</b>�utf-8� ☃)�soup�b�string�encode��self�htmlr s �<C:\Python312\Lib\site-packages\bs4/tests/test_pageelement.py�"test_unicode_string_can_be_encodedz/TestEncoding.test_unicode_string_can_be_encoded s@ � �#���y�y�����v�v�}�}�#�#�G�,�
�0D�0D�W�0M�M�M�M� c � � d}| j |� }|j j d� |j d� k( sJ �y )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 s8 � �#���y�y�����v�v�}�}�W�%����W�)=�=�=�=r c �j � d}| j |� }|j j d� dk( sJ �y )Nr �asciis <b>☃</b>r r s r �<test_encoding_substitutes_unrecognized_characters_by_defaultzITestEncoding.test_encoding_substitutes_unrecognized_characters_by_default! s0 � �#���y�y�����v�v�}�}�W�%�):�:�:�:r c � � d}| j |� }t j t � 5 |j dd�� d d d � y # 1 sw Y y xY w)Nr r �strict)�errors)r �pytest�raises�UnicodeEncodeErrorr r s r � test_encoding_can_be_made_strictz-TestEncoding.test_encoding_can_be_made_strict&