← Back
Editing: test_tap.cpython-38.pyc
U W[�* � @ s: d Z ddlmZmZ ddlZddlZddlmZmZ ddl m Z ddlmZ ddl mZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZmZ ddlmZ ddlmZ ddl m!Z!m"Z" ddl#m$Z$m%Z% ddl#m&Z&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z- e.� Z/G dd� de�Z0G dd� de�Z1dS )z Tests for L{twisted.web.tap}. � )�absolute_import�divisionN)�reactor� endpoints)�IReactorUNIX)�FilePath)� requireModule)� ThreadPool)� UsageError)�PBServerFactory)�TestCase)�demo)�ResourcePublisher� UserDirectory)�PythonScript)�Site)�Data�File)�Options�makeService)�makePersonalServerFactory�_AddHeadersResource)�DummyRequest)� CGIScript)�WSGIResourcec @ s� e Zd ZdZdd� Zdd� Zdd� Ze�e �s4de_ d d � Zdd� Zd d� Z dd� Zdd� Ze�e �slde_ dd� Ze�e �s�de_ dd� Zdd� Zdd� Zdd� Zdd� Zed�d k r�d!e_ d"d#� Zed�d kr�d$e_ d%d&� Zd'd(� Zd S ))�ServiceTestszD Tests for the service creation APIs in L{twisted.web.tap}. c C s: t | �� �}|�� t� }|�d|jg� |d }||fS )a� Helper for the I{--path} tests which creates a directory and creates an L{Options} object which uses that directory as its static filesystem root. @return: A two-tuple of a L{FilePath} referring to the directory and the value associated with the C{'root'} key in the L{Options} instance after parsing a I{--path} option. �--path�root)r �mktemp�makedirsr �parseOptions�path)�selfr! �optionsr � r$ �;/usr/lib/python3/dist-packages/twisted/web/test/test_tap.py�_pathOption'