File: //usr/lib/python3/dist-packages/twisted/web/test/__pycache__/test_vhost.cpython-310.pyc
o
�b1 � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ dd lmZ dd
lmZmZmZ G dd� de�ZG d
d� de�ZG dd� de�ZdS )z!
Tests for L{twisted.web.vhost}.
� )�
gatherResults)�TestCase)� NOT_FOUND)�
NoResource)�Site)�Data)�_render)�DummyRequest)�NameVirtualHost�VHostMonsterResource�
_HostResourcec @ � 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�}g d �|_t|�|_ d
d� |_
d|_|�d|�}| �
|t � tddg�}|�d|�}| �
|t� d
S )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 data� baz.com)s bar� httpr c S s dS )NF� r r r �=/usr/lib/python3/dist-packages/twisted/web/test/test_vhost.py�<lambda>- s z1HostResourceTests.test_getChild.<locals>.<lambda>� N)r �putChildr r
�default�addHostr �prepathr �site�isSecure�host�getChild�assertIsInstancer )�self�bazroot�bazuri�baztest�hr�root�request�stepr r r �
test_getChild s&