0x1949 Team - FAZEMRX - MANAGER
Edit File: _util.cpython-310.pyc
o �bf � @ s� d Z ddlmZ ddlmZmZ ddlmZ ddlm Z ddl mZ ddlm Z ddlmZ d d � ZG dd� de�Zd d� Zg d�ZdS )z0 General helpers for L{twisted.web} unit tests. � )�Type)�Deferred�succeed)�SynchronousTestCase)�server)� flattenString)�FlattenerError)�Flattenablec C s\ | � |�}t|t�r|�|� |�� td �S |tju r'|jr#td �S |� � S t d|����)NzUnexpected return value: )�render� isinstance�bytes�write�finishr r �NOT_DONE_YET�finished�notifyFinish� ValueError)�resource�request�result� r �8/usr/lib/python3/dist-packages/twisted/web/test/_util.py�_render s r c @ sZ e Zd ZdZdededee fdd�Zdededefdd�Zded e e dd fdd�Zd S ) �FlattenTestCasezH A test case that assists with testing L{twisted.web._flatten}. �root�target�returnc s0 dt dt f� �fdd�}td|�}|�|� |S )zS Assert that a root element, when flattened, is equal to a string. r r c s � � | ��S )N)�assertEqual)r ��selfr r r �check, s z/FlattenTestCase.assertFlattensTo.<locals>.checkN)r r �addCallback)r r r r �dr r r �assertFlattensTo'