Sindbad~EG File Manager
a
��g�$ � @ s~ d Z ddlZddlZddlZddlZddlmZ ddlmZm Z ej
dkZdZej
dkZ
G dd � d ej�Zed
krze�� dS )z9
Test the implementation of the PEP 540: the UTF-8 Mode.
� N)�support)�assert_python_ok�assert_python_failure�win32)�CZPOSIXZvxworksc @ s� e Zd Zdddd�Zdd� Zdd�dd �Ze�ed
�dd� �Z d
d� Z
dd� Zdd� Zdd� Z
dd� Zd'dd�Zdd� Zdd� Zdd� Zd d!� Ze�ed"�d#d$� �Zd%d&� ZdS )(�
UTF8ModeTests� �0)�
PYTHONUTF8�PYTHONLEGACYWINDOWSFSENCODINGZPYTHONCOERCECLOCALEc C s t �t jd �}|tv S )N)�locale� setlocale�LC_CTYPE�
POSIX_LOCALES)�self�loc� r �//usr/local/lib/python3.9/test/test_utf8_mode.py�posix_locale s zUTF8ModeTests.posix_localeF)�failurec O sR t | jfi |��}|r.t|i |��}|d }nt|i |��}|d }|�� �d�S )N� � z
)�dict�DEFAULT_ENVr r �decode�rstrip)r r �args�kw�outr r r �
get_output s
zUTF8ModeTests.get_outputzWindows has no POSIX localec C sZ d}t D ]L}| j|d��, | jd||d�}| �|d� W d � q1 sJ0 Y qd S )N�&import sys; print(sys.flags.utf8_mode)��LC_ALL�-c�1)r �subTestr �assertEqual)r �coder r r r r �test_posix_locale&