관리-도구
편집 파일: test_contracts.cpython-311.pyc
� P�Dg�i � �� � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl mZ ddl mZ ddl m Z ddl mZ ddl mZ dd l mZ dd l mZ ddl mZ ddl mZ dd l mZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ 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"lm+Z+ dd#lm,Z, ddl Z G d$� d%e'� � Z- G d&� d'e'� � Z. G d(� d)e'� � Z/ G d*� d+e'� � Z0 G d,� d-e'� � Z1d.� Z2e) G d/� d0e'� � � � Z3e4d1k rdd2l5m6Z6 e6e7� � dS dS )3z�Contracts tests. These tests mainly check API sanity in terms of returned types and APIs availability. Some of these are duplicates of tests test_system.py and test_process.py � N)�AIX)�BSD)�FREEBSD)�LINUX)�MACOS)�NETBSD)�OPENBSD)�OSX)�POSIX)�SUNOS)�WINDOWS)�FileNotFoundError)�long)�range)�APPVEYOR)�check_connection_ntuple)� CI_TESTING)�create_sockets)�enum)�GITHUB_ACTIONS)�HAS_CPU_FREQ)�HAS_NET_IO_COUNTERS)�HAS_SENSORS_FANS)�HAS_SENSORS_TEMPERATURES)� is_namedtuple)�kernel_version)�process_namespace)�PsutilTestCase)�PYPY)� serialrun)�SKIP_SYSCONS)�unittest)�VALID_PROC_STATUSESc �^ � e Zd Zd� Zd� Zd� Zd� Z ej e oe d� � d� � � ZdS )�TestAvailConstantsAPIsc �~ � | � t t d� � t p t pt � � d S )N�PROCFS_PATH)�assertEqual�hasattr�psutilr r r ��selfs �}/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib64/python3.11/site-packages/psutil/tests/test_contracts.py�test_PROCFS_PATHz'TestAvailConstantsAPIs.test_PROCFS_PATHB s= � �������7�7��.�%�.�3� 0� 0� 0� 0� 0� c �� � | j } |t t d� � t � � |t t d� � t � � |t t d� � t � � |t t d� � t � � |t t d� � t � � |t t d� � t � � d S )N�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�r( r) r* r �r, �aes r- �test_win_priorityz(TestAvailConstantsAPIs.test_win_priorityF s� � � � �� ��7�6�8�9�9�7�C�C�C� ��7�6�8�9�9�7�C�C�C� ��7�6�0�1�1�7�;�;�;� ��7�6�0�1�1�7�;�;�;� ��7�6�2�3�3�W�=�=�=� ��7�6�4�5�5�w�?�?�?�?�?r/ c �4 � | j } |t t d� � t � � |t t d� � t � � |t t d� � t � � |t t d� � t � � d S )N�IOPRIO_CLASS_NONE�IOPRIO_CLASS_RT�IOPRIO_CLASS_BE�IOPRIO_CLASS_IDLE�r( r) r* r r8 s r- �test_linux_ioprio_linuxz.TestAvailConstantsAPIs.test_linux_ioprio_linuxO s� � � � �� ��7�6�.�/�/��7�7�7� ��7�6�,�-�-�u�5�5�5� ��7�6�,�-�-�u�5�5�5� ��7�6�.�/�/��7�7�7�7�7r/ c �4 � | j } |t t d� � t � � |t t d� � t � � |t t d� � t � � |t t d� � t � � d S )N�IOPRIO_HIGH� IOPRIO_NORMAL� IOPRIO_LOW�IOPRIO_VERYLOWr7 r8 s r- �test_linux_ioprio_windowsz0TestAvailConstantsAPIs.test_linux_ioprio_windowsV s� � � � �� ��7�6�=�)�)�7�3�3�3� ��7�6�?�+�+�W�5�5�5� ��7�6�<�(�(�'�2�2�2� ��7�6�+�,�,�g�6�6�6�6�6r/ �%unsupported on GITHUB_ACTIONS + LINUXc � � | j } |t t d� � t pt � � |t t d� � t pt � � |t t d� � t pt � � |t t d� � t pt � � |t t d� � t pt � � |t t d� � t pt � � |t t d� � t pt � � |t t d� � t pt � � |t t d � � t pt � � |t t d � � t pt � � |t t d� � t pt � � |t t d� � t � � t �rt � � d k r$ |t t d� � t � � t � � dk r$ |t t d� � t � � t � � dk r$ |t t d� � t � � t � � dk r$ |t t d� � t � � t � � d k r$ |t t d� � t � � |t t d� � t � � |t t d� � t � � |t t d� � t � � d S )N� RLIM_INFINITY� RLIMIT_AS�RLIMIT_CORE� RLIMIT_CPU�RLIMIT_DATA�RLIMIT_FSIZE�RLIMIT_MEMLOCK� RLIMIT_NOFILE�RLIMIT_NPROC� RLIMIT_RSS�RLIMIT_STACK�RLIMIT_LOCKS)� � � �RLIMIT_MSGQUEUE)rV rW � �RLIMIT_NICE� RLIMIT_RTPRIO)rV rW � � RLIMIT_RTTIME�RLIMIT_SIGPENDING�RLIMIT_SWAP� RLIMIT_SBSIZE�RLIMIT_NPTS)r( r) r* r r r r r8 s r- �test_rlimitz"TestAvailConstantsAPIs.test_rlimit] s� � � � �� ��7�6�?�+�+�U�-=�g�>�>�>� ��7�6�;�'�'��)9�'�:�:�:� ��7�6�=�)�)�5�+;�G�<�<�<� ��7�6�<�(�(�%�*:�7�;�;�;� ��7�6�=�)�)�5�+;�G�<�<�<� ��7�6�>�*�*�E�,<�W�=�=�=� ��7�6�+�,�,�e�.>�w�?�?�?� ��7�6�?�+�+�U�-=�g�>�>�>� ��7�6�>�*�*�E�,<�W�=�=�=� ��7�6�<�(�(�%�*:�7�;�;�;� ��7�6�>�*�*�E�,<�W�=�=�=� ��7�6�>�*�*�E�2�2�2�� @����9�,�,���7�6�#4�5�5�u�=�=�=����:�-�-���7�6�=�1�1�5�9�9�9����:�-�-���7�6�?�3�3�U�;�;�;����:�-�-���7�6�?�3�3�U�;�;�;����9�,�,���7�6�#6�7�7��?�?�?� ��7�6�=�)�)�7�3�3�3� ��7�6�?�+�+�W�5�5�5� ��7�6�=�)�)�7�3�3�3�3�3r/ N)�__name__� __module__�__qualname__r. r: rA rG r"