관리-도구
편집 파일: test_process.cpython-36.opt-1.pyc
3 ��JZ9� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlm"Z" ddlm#Z# ddlm$Z$ ddlm%Z% ddlm&Z& ddlm'Z' ddlm(Z( ddlm)Z) ddlm*Z* ddlm+Z+ ddlm,Z, ddlm-Z- dd lm.Z. dd!lm/Z/ dd"lm0Z0 dd#lm1Z1 dd$lm2Z2 dd%lm3Z3 dd&lm4Z4 dd'lm5Z5 dd(lm6Z6 dd)lm7Z7 dd*lm8Z8 dd+lm9Z9 dd,lm:Z: dd-lm;Z; dd.lm<Z< dd/lm=Z= G d0d1� d1e;j>�Z?e�r�ej@� dk�r�G d2d3� d3e?�ZAG d4d5� d5e;j>�ZBeCd6k�r�e2eD� dS )7zTests for psutil.Process class.� N)�AIX)�BSD)�LINUX)�NETBSD)�OPENBSD)�OSX)�POSIX)�SUNOS)�WINDOWS)�long)�PY3)�APPVEYOR)� call_until)�copyload_shared_lib)� create_exe)�create_proc_children_pair)�create_zombie_proc)�enum)�get_test_subprocess)� get_winver)�HAS_CPU_AFFINITY)�HAS_ENVIRON)� HAS_IONICE)�HAS_MEMORY_MAPS)�HAS_PROC_CPU_NUM)�HAS_PROC_IO_COUNTERS)� HAS_RLIMIT)�HAS_THREADS)�mock)�PYPY)� PYTHON_EXE)� reap_children)�retry_before_failing)�run_test_module_by_name)�safe_rmpath)�sh)�skip_on_access_denied)�skip_on_not_implemented)�TESTFILE_PREFIX)�TESTFN)� ThreadTask)�TRAVIS)�unittest)�wait_for_pid)� WIN_VISTAc @ sr e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zeje d�dd� �Zdd � Zeje d!�ejed"�d#d$� ��Zeje d�eed%�d&d'� ��Zeje d�ejeo�e� e k d�d(d)� ��Z!eje d�eje�oe� e k d�d*d+� ��Z"eje# d�d,d-� �Z$eje# d�d.d/� �Z%eje# d�d0d1� �Z&eje# d�d2d3� �Z'eje# d�d4d5� �Z(d6d7� Z)eje d8�d9d:� �Z*eje+ d�d;d<� �Z,e-� e.e/d%�eje+ d�d=d>� ���Z0d?d@� Z1dAdB� Z2eje3 d�dCdD� �Z4eje3 d�dEdF� �Z5dGdH� Z6dIdJ� Z7dKdL� Z8dMdN� Z9dOdP� Z:eje;dQ�eje<dR�dSdT� ��Z=eje d!�dUdV� �Z>eje d!�dWdX� �Z?dYdZ� Z@d[d\� ZAd]d^� ZBd_d`� ZCdadb� ZDejeE d�dcdd� �ZFejeE d�dedf� �ZGejeE d�dgdh� �ZHejeIdi�ejeJdj�dkdl� ��ZKejeIdi�ejeJdj�dmdn� ��ZLeje d!�dodp� �ZMeed%�ejeN�pzeOdq�drds� ��ZPdtdu� ZQdvdw� ZRdxdy� ZSdzd{� ZTd|d}� ZUd~d� ZVd�d�� ZWd�d�� ZXd�d�� ZYd�d�� ZZd�d�� Z[d�d�� Z\eje d!�d�d�� �Z]eje d!�d�d�� �Z^eje d!�d�d�� �Z_d�d�� Z`ejea d�d�d�� �Zbejea d�eje d!�d�d�� ��Zcd�S )��TestProcesszTests for psutil.Process class.c C s t t� d S )N)r$ r) )�self� r1 �$/usr/lib64/python3.6/test_process.py�setUpN s zTestProcess.setUpc C s t � d S )N)r! )r0 r1 r1 r2 �tearDownQ s zTestProcess.tearDownc C sX t j� }| j|jtj� � t� }| jt j|j�j|j� | jt�� d|_W d Q R X d S )N�! ) �psutil�Process�assertEqual�pid�os�getpidr �assertRaises�AttributeError)r0 �p�sprocr1 r1 r2 �test_pidT s zTestProcess.test_pidc C sN t � }|j}tj|�}|j� |j� }| jtj|�� trJ| j |t j � d S )N)r r9 r6 r7 �kill�wait�assertFalse� pid_existsr r8 �signal�SIGKILL)r0 r? r@ r>