Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/names/test/__pycache__/ |
Upload File : |
o �b� � @ s� d Z ddlZddlZddlmZ ddlmZ ddlmZm Z G dd� d�Z G dd � d e e �ZG d d� de e �ZG dd � d e e �Z G dd� de e �ZdS )z- Tests for L{twisted.names} example scripts. � N)�StringIO)�FilePath)�SkipTest�TestCasec @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� ZdS ) �ExampleTestBasea� This is a mixin which adds an example to the path, tests it, and then removes it from the path and unimports the modules which the test loaded. Test cases which test example code and documentation listings should use this. This is done this way so that examples can live in isolated path entries, next to the documentation, replete with their own plugin packages and whatever other metadata they need. Also, example code is a rare instance of it being valid to have multiple versions of the same code in the repository at once, rather than relying on version control, because documentation will often show the progression of a single piece of code as features are added to it, and we want to test each one. c C s� t jdd� | _t j�� | _t� | _| �t d| j� t� | _ | �t d| j � zt tjd �� d�}W n ty= td��w | j�d�D ]}|� |�}|�� sXtd|j� d ���qD|| _t j�| j�� j� | j�� �d �d }t|�| _dS )zn Add our example directory to the path and record which modules are currently loaded. N�stderr�stdout�TOX_INI_DIR�docsz5Examples not found ($TOX_INI_DIR unset) - cannot test�/z Examples (z) not found - cannot test�.r )�sys�path�originalPath�modules�copy�originalModulesr �fakeErr�patch�fakeOutr �os�environ�child�KeyErrorr �exampleRelativePath�split�exists�examplePath�append�parent�basename� __import__�example)�self�here� childName� moduleName� r'