File: //proc/self/root/lib/python3/dist-packages/twisted/web/test/__pycache__/test_vhost.cpython-38.pyc
U
s�@g� � @ s� d Z ddlmZmZ ddlmZ ddlmZ ddlm Z ddl
mZ ddlm
Z
ddlmZ dd lmZmZmZ dd
lmZ ddlmZ G dd
� d
e�ZG dd� de�ZG dd� de�ZdS )z!
Tests for L{twisted.web.vhost}.
� )�absolute_import�division)�
gatherResults)�TestCase)� NOT_FOUND)�
NoResource)�Data)�Site)�
_HostResource�NameVirtualHost�VHostMonsterResource)�DummyRequest)�_renderc @ s e Zd ZdZdd� ZdS )�HostResourceTestsz%
Tests for L{_HostResource}.
c C s� t dd�}t dd�}t dd�}|�d|� |�d|� t� }t� }t dd�|_|�d|� tddg�}d d
dg|_t|�|_ dd� |_
d
|_|�d|�}| �
|t � tddg�}|�d|�}| �
|t� dS )z�
L{_HostResource.getChild} returns the proper I{Resource} for the vhost
embedded in the URL. Verify that returning the proper I{Resource}
required changing the I{Host} in the header.
s root data� s uri datas test datas tests uris default datas baz.coms bar� httpc S s dS )NF� r r r �=/usr/lib/python3/dist-packages/twisted/web/test/test_vhost.py�<lambda>/ � z1HostResourceTests.test_getChild.<locals>.<lambda>r N)r ZputChildr
r �default�addHostr
�prepathr Zsite�isSecureZhost�getChild�assertIsInstancer )�selfZbazrootZbazuriZbaztestZhr�root�request�stepr r r �
test_getChild s&