Current File : //lib/python3/dist-packages/twisted/application/twist/test/__pycache__/test_options.cpython-312.pyc |
�
Ϫ�f�, � �. � d Z ddlmZmZ ddlmZmZmZmZm Z m
Z
ddlZddl
mZ ddlmZ ddlmZ ddlmZ dd lmZmZmZmZ dd
lmZ ddlmZ dd
lmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl%m&Z& G d� dejN jP jR � Z*y)z2
Tests for L{twisted.application.twist._options}.
� )�stderr�stdout)�Callable�Dict�List�Optional�TextIO�TupleN)�version)�reactor)�IReactorCore)�
MemoryReactor)�FileLogObserver�LogLevel�jsonFileLogObserver�textFileLogObserver)�
UsageError� )�
NoSuchReactor)�
ExitStatus)� DummyExit)�ServiceMaker)�_options� )�TwistOptionsc � � e Zd ZdZd$d�Zd$d�Zd$d�Zd$d�Zd$d�Zd$d �Z d$d
�Z
d$d�Zd$d�Zd$d
�Z
d$d�Zdededdfd�Zd$d�Zd$d�Zd$d�Zd$d�Zdedeegef ddfd�Zd$d�Zd$d�Zd$d�Zd$d�Zd$d�Zd$d�Zd$d�Zd$d �Z d$d!�Z!d$d"�Z"d$d#�Z#y)%�OptionsTestsz$
Tests for L{TwistOptions}.
�returnNc �d � t � | _ | j t d| j � y)zX
Patch L{_twist.exit} so we can capture usage and prevent actual exits.
�exitN)r r �patchr ��selfs �M/usr/lib/python3/dist-packages/twisted/application/twist/test/test_options.py� patchExitzOptionsTests.patchExit$ s! � � �K�� ��
�
�8�V�T�Y�Y�/� c � � � g � _ ddt dt t dt f� fd�
}� j t
d|� y)zZ
Patch L{_options.open} so we can capture usage and prevent actual opens.
N�name�moder c �n �� | dk( r
t d d | � ��j j | |f� t S )N� nocanopen)�OSError�opened�append�NotImplemented)r( r) r# s �r$ �fakeOpenz(OptionsTests.patchOpen.<locals>.fakeOpen1 s6 �� ��{�"��d�D�$�/�/��K�K����d�|�,�!�!r&