| 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 �g�E � � � d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZmZ G d� de � Z
G d� de � Z G d� d e � Zy)
� N)�
BeautifulSoup)�EntitySubstitution�EncodingDetector�
UnicodeDammitc � � e Zd ZdZd� Zej j dg d�� d� � Zd� Z d� Z
d� Zd � Zd
� Z
d� Zy)
�TestUnicodeDammitz"Standalone tests of UnicodeDammit.c �@ � d}t |� }|j |k( sJ �y )Nu I'm already Unicode! ☃)r �unicode_markup)�self�markup�dammits �7C:\Python312\Lib\site-packages\bs4/tests/test_dammit.py�test_unicode_inputz$TestUnicodeDammit.test_unicode_input s% � �3���v�&���$�$��.�.�.� z smart_quotes_to,expect_converted))Nu ‘’“”)�xmlz ‘’“”)�htmlz‘’“”)�asciiz''""c �f � d}t |dg|�� j }|dj |� k( sJ �y)zbVerify the functionality of the smart_quotes_to argument
to the UnicodeDammit constructor.s <foo>����</foo>�windows-1252)�known_definite_encodings�smart_quotes_toz
<foo>{}</foo>N)r r
�format)r r �expect_convertedr � converteds r �test_smart_quotes_toz&TestUnicodeDammit.test_smart_quotes_to sE � � 0��!��&4�%5�+�
� �.� �
�O�2�2�3C�D�D�D�Dr c �~ � d}t |� }|j j � dk( sJ �|j dk( sJ �y )Ns Sacré bleu! ☃�utf-8u Sacré bleu! ☃�r �original_encoding�lowerr
)r �utf8r
s r �test_detect_utf8z"TestUnicodeDammit.test_detect_utf8* sC � �1���t�$���'�'�-�-�/�7�:�:�:��$�$�(D�D�D�Dr c � � d}t |dg� }|j j � dk( sJ �|j dk( sJ �y )N� ���
iso-8859-8u םולשr )r �hebrewr
s r �test_convert_hebrewz%TestUnicodeDammit.test_convert_hebrew0 sG � �$���v��~�6���'�'�-�-�/�<�?�?�?��$�$�(B�B�B�Br c � � d}t |� }|j j � dk( sJ �|j j d� |k( sJ �y )Ns ケータイ Watchr )r r r r
�encode)r �utf_8r
s r �/test_dont_see_smart_quotes_where_there_are_nonezATestUnicodeDammit.test_dont_see_smart_quotes_where_there_are_none6 sM � �I���u�%���'�'�-�-�/�7�:�:�:��$�$�+�+�G�4��=�=�=r c �~ � dj d� }t |dg� }|j j � dk( sJ �y )N�
Räksmörgåsr r% �r) r r r �r � utf8_datar
s r � test_ignore_inappropriate_codecsz2TestUnicodeDammit.test_ignore_inappropriate_codecs<