File: //proc/thread-self/root/usr/local/lib/python3.7/test/__pycache__/test_bigmem.cpython-37.pyc
B
��g�� � @ s d Z ddlmZ ddlmZmZmZmZ ddlZddl Z ddl
Z
dZdZdZ
e
jdk rZdnd ZG d
d� d�ZG dd
� d
eje�ZG dd� deje�ZG dd� deje�ZG dd� dej�ZG dd� dej�Zdd� Zedk�ree
j�dkr�e�e
jd � e� dS )a� Bigmem tests - tests for the 32-bit boundary in containers.
These tests try to exercise the 32-bit boundary that is sometimes, if
rarely, exceeded in practice, but almost never tested. They are really only
meaningful on 64-bit builds on machines with a *lot* of memory, but the
tests are always run, usually with very low memory limits to make sure the
tests themselves don't suffer from bitrot. To run them for real, pass a
high memory limit to regrtest, with the -M option.
� )�support)�
bigmemtest�_1G�_2G�_4GN� � � l � c @ s< e Zd Zdd� Zeed dd�dd� �Zeedd�d d
� �Zeedd�dd� �Zeed dd�d
d� �Z eedd�dd� �Z
eedd�dd� �Zeedd�dd� �Zeedd�dd� �Z
eedd�dd� �Zeedd�dd� �Zeedd�dd� �Zeedd�dd� �Zeedd�dd � �Zeedd�d!d"� �Zeed dd�d#d$� �Zeed dd�d%d&� �Zeed dd�d'd(� �Zeed dd�d)d*� �Zeedd�d+d,� �Zeedd�d-d.� �Zeed dd�d/d0� �Zeed dd�d1d2� �Zeed3d�d4d5� �Zeed6 ed e d�d7d8� �Zeed3d�d9d:� �Z eedd�d;d<� �Z!eedd�d=d>� �Z"d?d@� Z#dAdB� Z$eedd�dCdD� �Z%eed6 dd�dEdF� �Z&eedG dd�dHdI� �Z'ee(d dJd�dKdL� �Z)ee(d dJd�dMdN� �Z*eedG dd�dOdP� �Z+eedd�dQdR� �Z,eed dd�dSdT� �Z-eed dd�dUdV� �Z.dWS )X�BaseStrTestc C s` | j }| � d�}|d�| | }|�� }| �|t|� d � |�� � | �|�|d��|� d S )Nz abc def ghi�-)�from_latin1�
capitalize�assertEqual�len�lstrip)�self�size�_�SUBSTR�sZcaps� r �,/usr/local/lib/python3.7/test/test_bigmem.py�_test_capitalizeH s
zBaseStrTest._test_capitalize�
r )r �memusec C s~ | � d�}|�|�}| �t|�|� t|�t|� d }}t|�d rP|d7 }| �||| � |� | �|�� |�� � d S )Nz abc def ghir r )r
�centerr r �strip)r r r r ZlpadsizeZrpadsizer r r �test_centerQ s
zBaseStrTest.test_centerr c C s� | j }|d�}|d�| | }| �|�|d��|� ||d�7 }| �|�|d��|d � | �|�|d��d� | �|�|d��d� | �|�|d��d� d S ) Nz abc def ghi�.r � � �i�jr )r
r �count)r r r r r r r r �
test_count\ s zBaseStrTest.test_countc C s� | j }|d�}|d�| | }| �|�|�� | �|�|�� |d�| }| �|�|�� | �|�|d�| �� | �|�|�� d S )Nz abc def ghir z...�a)r
�
assertTrue�endswith�assertFalse)r r r r r �s2r r r �
test_endswithh s zBaseStrTest.test_endswithc C s� | j }|d�| }d}| �|�� |k� ~t||�\}}|d�| }|�|�}| �t|�|| � | �t|�|d���d� d S )Nr r
z r r )r
r'