File: D:/Python311/Lib/test/__pycache__/test_urllib_response.cpython-311.opt-2.pyc
�
��Vc@ � � � d dl Z d dlZd dlZd dlZd dlmZ ej r ej d� � � G d� dej � � Z
edk r ej � � dS dS )� N)�supportzCannot create socket on WASIc �2 � e Zd Zd� Zd� Zd� Zd� Zd� Zd� ZdS )�TestResponsec � � t j t j t j � � | _ | j � d� � | _ ddd�| _ d S )N�rbzwww.python.org�close)�Host�
Connection)�socket�AF_INET�SOCK_STREAM�sock�makefile�fp�test_headers��selfs �-D:\Python311\Lib\test\test_urllib_response.py�setUpzTestResponse.setUp sL � ��M�&�.�&�2D�E�E�� ��)�$�$�T�*�*���%5�+2�4� 4����� c �` �� t j � | j � � �| � �t
j � � �fd�}| � | j j � � |� � | � | j j � � | �
t |� � d S )Nc �@ �� �5 } d d d � � d S # 1 swxY w Y d S �N� )�spam�addbases �r �fz!TestResponse.test_with.<locals>.f sm �� ��
�D��
�
�
�
�
�
�
�
�
�
�
�
����
�
�
�
�
�
s ���)�urllib�responser r �assertIsInstance�tempfile�_TemporaryFileWrapper�assertFalse�closed�
assertTrue�assertRaises�
ValueError)r r r s @r � test_withzTestResponse.test_with s� �� ��/�)�)�$�'�2�2�����g�x�'E�F�F�F� � � � � �
������(�(�(� �����������'�'�'����*�a�(�(�(�(�(r c �� �� d��fd�}t j � | j |� � }|� � � | � | j j � � | � �� � d S )NFc � �� d� d S )NTr )�closehook_calleds �r � closehookz1TestResponse.test_addclosehook.<locals>.closehook% s �� �#���r )r r �addclosehookr r r% r$ )r r, r+ s @r �test_addclosehookzTestResponse.test_addclosehook"