Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pyroute2/config/__pycache__/test_platform.cpython-39.pyc
Ðазад
a ]�h1! � @ s� d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl m Z ddlmZ ddl mZ G dd� de�ZG d d � d e�Zdd� Zed kr�e� dS )z5 Platform tests to discover the system capabilities. � N)�config)�uifname)� RawIPRoute)�RTMGRP_LINKc @ s e Zd ZdS )�SkipTestN)�__name__� __module__�__qualname__� r r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pyroute2/config/test_platform.pyr s r c @ s� e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zd&S )'�TestCapsRtnla A minimal test set to collect the RTNL implementation capabilities. It uses raw RTNL sockets and doesn't run any proxy code, so no transparent helpers are executed -- e.g., it will not create bridge via `brctl`, if RTNL doesn't support it. A short developer's guide:: def test_whatever_else(self): code This test will create a capability record `whatever_else`. If the `code` fails, the `whatever_else` will be set to `False`. If it throws the `SkipTest` exception, the `whatever_else` will be set to `None`. Otherwise it will be set to whatever the test returns. To collect the capabilities:: tce = TestCapsExt() tce.collect() print(tce.capabilities) Collected capabilities are in the `TestCapsExt.capabilities` dictionary, you can use them directly or by setting the `config.capabilities` singletone:: from pyroute2 import config # ... tce.collect() config.capabilities = tce.capabilities c C sB i | _ g | _i | _i | _i | _t�� \| _| _d | _ t �� | _d S �N) �capabilities�ifnames�rtm_newlink�rtm_dellink� rtm_events�os�pipe�cmd�cmdw�ip� threading�Event�event��selfr r r �__init__: s zTestCapsRtnl.__init__c C s | j | S r �r )r �keyr r r �__getitem__D s zTestCapsRtnl.__getitem__c C s || j |<