관리-도구
편집 파일: test_windows.cpython-36.pyc
3 ��JZK � @ s` d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddlm Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ej� �Z ejd� y$ddlZddlZddlZddlZW n$ e k �rD ej!dk�r@� Y nX W dQ R X ej"j#Z#e j$d$kZ%dd� Z&ej'e d�G dd� dej(��Z)ej'e d�G dd� dej(��Z*ej'e d�G dd� dej(��Z+ej'e d�G dd� dej(��Z,ej'e d�G dd� dej(��Z-ej'e d�G dd � d ej(��Z.ej'e d�G d!d"� d"ej(��Z/e0d#k�r\ee1� dS )%zWindows specific tests.� N)�WINDOWS)�callable)�APPVEYOR)�get_test_subprocess)�HAS_BATTERY)�mock)� reap_children)�retry_before_failing)�run_test_module_by_name)�sh)�unittest�ignore�nt� � c s � fdd�}|S )Nc st y� | f|�|�S t k rn } zBddlm} |j|krDtjd d ��|jtjkr\tjd d ��� W Y d d }~X nX d S )Nr )�ACCESS_DENIED_SET)�OSErrorZpsutil._pswindowsr �errno�psutil�AccessDeniedZESRCH� NoSuchProcess)�self�args�kwargs�errr )�fun� �$/usr/lib64/python3.6/test_windows.py�wrapper5 s z wrap_exceptions.<locals>.wrapperr )r r r )r r �wrap_exceptions4 s r zWINDOWS onlyc @ s� e Zd Zdd� Zejdejkd�dd� �Zdd� Z d d � Z dd� Zejed �e � dd� ��Ze � dd� �Zdd� Zdd� Zdd� Zdd� Zdd� ZdS )�TestSystemAPIsc C sV t d�}tjdd�j� }x8|D ]0}d|jdd�j� kr8q||kr| jd| � qW d S )Nz ipconfig /allT)Zperniczpseudo-interface� �-z-%r nic wasn't found in 'ipconfig /all' output)r r Znet_io_counters�keys�replace�lower�fail)r �outZnicsZnicr r r �test_nic_namesJ s zTestSystemAPIs.test_nic_names�NUMBER_OF_PROCESSORSz-NUMBER_OF_PROCESSORS env var is not availablec C s"