%PDF- %PDF-
Direktori : /snap/core18/current/usr/lib/python3.6/test/__pycache__/ |
Current File : //snap/core18/current/usr/lib/python3.6/test/__pycache__/test_support.cpython-36.pyc |
3 /�$h�L � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlmZ d dl mZ ejZG dd� de j�Zdd� Zedkr�e� dS ) � N)�support)� script_helperc @ s� e Zd Zdd� Zdd� Zdd� Zejd�dd � �Zd d� Z dd � Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zejeed �d!�d"d#� �Zd$d%� Zd&d'� Zd(d)� Zd*d+� Zd,d-� Zd.d/� Zd0d1� Zd2d3� Zd4d5� Z d6d7� Z!d8d9� Z"d:d;� Z#d<d=� Z$d>d?� Z%d@dA� Z&dBdC� Z'dDdE� Z(dFdG� Z)G dHdI� dI�Z*G dJdK� dK�Z+dLdM� Z,dNdO� Z-dPdQ� Z.d]dSdT�Z/dUdV� Z0dWdX� Z1dYdZ� Z2d[d\� Z3dRS )^�TestSupportc C s t jd� | jtjt jd� d S )N�ftplib�foo)r � import_module�assertRaises�unittest�SkipTest)�self� r �'/usr/lib/python3.6/test/test_support.py�test_import_module s zTestSupport.test_import_modulec C s t jd� d S )Nr )r Zimport_fresh_module)r r r r �test_import_fresh_module s z$TestSupport.test_import_fresh_modulec C s. | j tj| d�| j� | jtjtj| d� d S )N�test_get_attributer )�assertEqualr Z get_attributer r r r )r r r r r s zTestSupport.test_get_attributezfailing buildbotsc C s | j tj� tj� d S )N)r r Zget_original_stdout�sys�stdout)r r r r �test_get_original_stdout s z$TestSupport.test_get_original_stdoutc C s2 dd l }| jdtj� tjd� | jdtj� d S )Nr �sched)r �assertInr �modulesr Zunload�assertNotIn)r r r r r �test_unload$ s zTestSupport.test_unloadc C s@ t td��}W d Q R X tjt� | jtjjt�� tjt� d S )N�w)�open�TESTFNr �unlink�assertFalse�os�path�exists)r �fr r r �test_unlink* s zTestSupport.test_unlinkc C s$ t jd }tjj|d�}tj|� tj|� t j|� | jtjj|�� t j t dd�� t j|� W d Q R X tj|� tj|� tj |tjtj B � t j t dd�� t j|� W d Q R X | jtjj|�� tj|� tj|� tj |d� t j t dd�� t j|� W d Q R X | jtjj|�� d S )N�dZsubdir�verboser )r r r r �join�mkdir�rmtreer r! � swap_attr�chmod�stat�S_IRUSR�S_IXUSR)r �dirpathZ subdirpathr r r �test_rmtree1 s( zTestSupport.test_rmtreec C s� t d }t|d��}td|d� W d Q R X tjjdtj� tj � z2t t �}| jt tj� t jt � | jt tj� W d tjd= t j|� t jd� X d S )Nz.pyr zfoo = 1)�filer �__pycache__)r r �printr r �insertr �curdir� importlib�invalidate_caches� __import__r r r Zforgetr r r( )r Zmod_filenamer"