File: //usr/share/doc/python3-pycurl/tests/__pycache__/internals_test.cpython-36.pyc
3
uJ$Z � @ sh d dl Z d dlZyd dlZW n ek
r4 dZY nX d dlZd dlZddlmZ G dd� dej�Z dS )� N� )�utilc @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zed%k r�d&d'� Zd(d)� Zd*d+� Zd%S ),�
InternalsTestc C s t j� | _d S )N)r �DefaultCurl�curl)�self� r �=/builddir/build/BUILD/pycurl-7.43.0.2/tests/internals_test.py�setUp s zInternalsTest.setUpc C s | j j� | ` d S )N)r �close)r r r r �tearDown s
zInternalsTest.tearDownc C s | j jtjkst�d S )N)r �URL�pycurl�AssertionError)r r r r �test_constant_aliasing s z$InternalsTest.test_constant_aliasingc C sB t j� }y|j| j� W n t jk
r. Y nX ds<td��~d S )NFzDNo exception when trying to remove a handle that is not in CurlMulti)r � CurlMulti�
remove_handler �errorr )r �mr r r �test_remove_invalid_handle# s z(InternalsTest.test_remove_invalid_handlec C s* t j� }tj� }|j� |j|� ~~d S )N)r r r r r r )r r �cr r r �!test_remove_invalid_closed_handle- s
z/InternalsTest.test_remove_invalid_closed_handlec C sZ t j� }tj� }|j� y|j|� W n t jk
r< Y nX dsJtd��|j� ~~d S )Nr z;No exception when trying to add a close handle to CurlMulti)r r r r r �
add_handler r )r r r r r r �test_add_closed_handle4 s z$InternalsTest.test_add_closed_handlec C sN t j� }|j| j� y|j| j� W n t jk
r: Y nX dsHtd��~d S )Nr z5No exception when trying to add the same handle twice)r r r r r r )r r r r r �test_add_handle_twiceA s z#InternalsTest.test_add_handle_twicec C sX t j� }t j� }|j| j� y|j| j� W n t jk
rB Y nX dsPtd��~~d S )Nr zBNo exception when trying to add the same handle on multiple stacks)r r r r r r )r �m1�m2r r r �"test_add_handle_on_multiple_stacksL s z0InternalsTest.test_add_handle_on_multiple_stacksc C s<