File: //usr/local/lib/python3.7/test/__pycache__/test_httplib.cpython-37.opt-1.pyc
B
��g�2 � @ s d dl Z d dlmZ d dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl
Z
e
jZd dlm
Z
ej�e�Zej�ed�Zej�ed�Zej�ed�ZdZdZd Zd
Zde d Zd
ZdZe
jZG dd� d�ZG dd� de�ZG dd� dej �Z!G dd� dej"�Z#G dd� de�Z$G dd� de�Z%G dd� de�Z&G dd� de�Z'G dd� de�Z(G d d!� d!e(�Z)G d"d#� d#�Z*G d$d%� d%e�Z+G d&d'� d'e�Z,G d(d)� d)e�Z-G d*d+� d+e�Z.G d,d-� d-e�Z/G d.d/� d/e�Z0G d0d1� d1e�Z1G d2d3� d3e�Z2e3d4k�re
j4d5d6� dS )7� N)�client)�supportzkeycert.pemzkeycert2.pemzselfsigned_pythontestdotnet.pemz{HTTP/1.1 200 OK
Transfer-Encoding: chunked
a
hello worl
3
d!
8
and now
22
for something completely different
s7 hello world! and now for something completely differentz;foo=barz0
�0z
zX-Dummy: foo
X-Dumm2: bar
c @ sH e Zd Zejddfdd�Zdd� Zddd�Zdd � Zd
d� Z dd
� Z
dS )�
FakeSocketNc C sB t |t�r|�d�}|| _|| _d| _d| _d| _|| _|| _ d S )N�ascii� r F)
�
isinstance�str�encode�text� fileclass�data�
sendall_calls�file_closed�host�port)�selfr r r r � r �-/usr/local/lib/python3.7/test/test_httplib.py�__init__/ s
zFakeSocket.__init__c C s | j d7 _ | j|7 _d S )N� )r r
)r r
r r r �sendall: s zFakeSocket.sendallc C s6 |dkr|dkrt �� �| �| j�| _| j| j_| jS )N�r�rb)r ZUnimplementedFileModer r �file�
file_close�close)r �mode�bufsizer r r �makefile>