%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/twisted/web/test/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/twisted/web/test/__pycache__/test_vhost.cpython-312.pyc |
� Ϫ�f� � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ ddl mZ dd lmZ dd lmZmZmZ G d� de� Z G d � de� Z G d� de� Zy)z! Tests for L{twisted.web.vhost}. � )� gatherResults)�TestCase)� NOT_FOUND)� NoResource)�Site)�Data)�_render)�DummyRequest)�NameVirtualHost�VHostMonsterResource� _HostResourcec � � e Zd ZdZd� Zy)�HostResourceTestsz% Tests for L{_HostResource}. c �& � t dd� }t dd� }t dd� }|j d|� |j d|� t � }t � }t dd� |_ |j d|� t ddg� }g d �|_ t |� |_ d � |_ d|_ |j d|� }| j |t � t ddg� }|j d|� }| j |t � y) 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 � � y)NF� r � �=/usr/lib/python3/dist-packages/twisted/web/test/test_vhost.py�<lambda>z1HostResourceTests.test_getChild.<locals>.<lambda>- s � r r N)r �putChildr r �default�addHostr �prepathr �site�isSecure�host�getChild�assertIsInstancer )�self�bazroot�bazuri�baztest�hr�root�request�steps r � test_getChildzHostResourceTests.test_getChild s� � � �|�R�(���k�2�&���|�R�(�������)������(� �_��� ���O�R�0������Z��)����0�1��7����D�z���(�������{�{�:�w�/�����d�D�)����0�1���}�}�V�W�-�����d�J�/r N��__name__� __module__�__qualname__�__doc__r* r r r r r s � ��0r r c �: � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z y ) �NameVirtualHostTestsz' Tests for L{NameVirtualHost}. c � � t � }t dd� |_ t dg� }| j |j |� d� y)z� L{NameVirtualHost.render} returns the result of rendering the instance's C{default} if it is not L{None} and there is no I{Host} header in the request. s correct resultr r N)r r r r �assertEqual�render�r"