File: //usr/lib/python3/dist-packages/twisted/web/test/__pycache__/test_http_headers.cpython-310.pyc
o
�b�Z � @ s\ d Z ddlmZ ddlmZ ddlmZmZmZ dd� Z G dd� de�Z
G d d
� d
e�ZdS )z(
Tests for L{twisted.web.http_headers}.
� )�TestCase)�Headers)�bytesLinearWhitespaceComponents�sanitizedBytes�textLinearWhitespaceComponentsc C s� |D ]H}g }|� t||gi�� t� }|�||� |� |� t� }|�||g� |� |� |D ]}| �t|�� �||gfg� | �|�|�|g� q/qdS )a
Assert that the components are sanitized to the expected value as
both a header name and value, across all of L{Header}'s setters
and getters.
@param testCase: A test case.
@param components: A sequence of values that contain linear
whitespace to use as header names and values; see
C{textLinearWhitespaceComponents} and
C{bytesLinearWhitespaceComponents}
@param expected: The expected sanitized form of the component for
both headers names and their values.
N)�appendr �addRawHeader�
setRawHeaders�assertEqual�list�getAllRawHeaders�
getRawHeaders)�testCase�
components�expected� component�headers�added� setHeader�header� r �D/usr/lib/python3/dist-packages/twisted/web/test/test_http_headers.py�assertSanitized s
���r c @ s� e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd*d+� Zd,d-� Zd.d/� Zd0d1� Zd2d3� Zd4S )5�BytesHeadersTestszE
Tests for L{Headers}, using L{bytes} arguments for methods.
c C � t | tt� dS �zf
Linear whitespace in header names or values is replaced with a
single space.
N)r r r ��selfr r r �test_sanitizeLinearWhitespace: � z/BytesHeadersTests.test_sanitizeLinearWhitespacec C s&