관리-도구
편집 파일: test_osx.cpython-37.pyc
B �=�_~ � @ s d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm Z dd lmZ dd lmZ ddlm Z ddlmZ d d� Zdd� Zdd� Ze�e d�G dd� de��Ze�e d�G dd� de��Zedk�rddlmZ ee� dS )zmacOS specific tests.� N)�MACOS)�HAS_BATTERY)�PsutilTestCase)�retry_on_failure)�sh)�spawn_testproc)� terminate)�TOLERANCE_DISK_USAGE)�TOLERANCE_SYS_MEM)�unittestc C s6 t | �}|�� d }yt|�S tk r0 |S X dS )zmExpects a sysctl command with an argument and parse the result returning only the value of interest. � N)r �split�int� ValueError)Zcmdline�out�result� r �H/opt/alt/python37/lib64/python3.7/site-packages/psutil/tests/test_osx.py�sysctl s r c C sV ddl m} td�}x$|�d�D ]}| |kr P q W td��tt�d|��d��|� S )z)Wrapper around 'vm_stat' cmdline utility.r )�getpagesize�vm_stat� zline not foundz\d+) Zpsutil._psutil_posixr r r r r �re�search�group)�fieldr r �liner r r r % s r c C s� ddi}| }d}x@| r&| dd� � � s6| dd� dkrP|| d 7 }| dd � } qW t|�}| �� }xD|�� D ]\}}||krlP qlW |dkr�|d }|�� }ntd| ��|d di}x0t|dd � �D ]\}} d|d d >