Tryag File Manager
Home
-
Turbo Force
Current Path :
/
proc
/
self
/
root
/
usr
/
lib
/
python2.4
/
test
/
Upload File :
New :
File
Dir
//proc/self/root/usr/lib/python2.4/test/test_urllib2.pyc
mò ‚=5Dc�����������@���s˜��d��k��Z��d�k�l�Z�d��k�Z�d��k�Z�d��k�Z�d��k�Z�d�k�l�Z�l�Z�d�e��i �f�d�„��ƒ��YZ �d�f��d�„��ƒ��YZ�d�f��d�„��ƒ��YZ�d �e �f�d �„��ƒ��YZ�d�e�i�f�d�„��ƒ��YZ�d �f��d�„��ƒ��YZ�d�f��d�„��ƒ��YZ�d�f��d�„��ƒ��YZ�d�„��Z�d�e��i �f�d�„��ƒ��YZ�d�„��Z�d�e��i �f�d�„��ƒ��YZ�d�e��i �f�d�„��ƒ��YZ�d�e��i �f�d�„��ƒ��YZ�e�d�„�Z�e�d�j�o�e�d�e�ƒ�n�d��S( ���N(���s���test_support(���s���Requests���OpenerDirectort���TrivialTestsc�����������B���s���t��Z�d�„��Z�d�„��Z�RS(���Nc���������C���sý���|��i�t�t�i�d�ƒ�t�i�i�t�i�ƒ�i �d�d�ƒ�}�|�d�d�!d�j�o�|�d�}�n�t�i�d�j�o�d�|�i �d�d�ƒ�}�nH�t�i�d�j�o7�d��k�}�t�i �|�ƒ�}�|�i�|�i�d �d �ƒ�ƒ�}�n�d�|�}�t�i�|�ƒ�}�|�i�ƒ��}�|�i�ƒ��d��S(���Ns ���bogus urls���\t���/i���i���t���:t���mact���riscoss���/.s���./s ���file://%s(���t���selft���assertRaisest ���ValueErrort���urllib2t���urlopent���ost���patht���abspatht���__file__t���replacet���fnamet���namet���stringt���expandt ���translatet ���maketranst���file_urlt���ft���readt���buft���close(���R���R���R���R���R���R���(����(����t'���/usr/lib/python2.4/test/test_urllib2.pyt���test_trivial���s����! c������ ���C���s‹���d�d�d�d�g�f�d�d�d�g�f�d�d�d�d �d �d�d�d �g�f�d�d�d�d�g�f�g�}�x-�|�D]%�\�}�}�|��i�t�i�|�ƒ�|�ƒ�q^�Wd��S(���Ns���a,b,ct���at���bt���cs���path"o,l"og"i"cal, examples���path"o,l"og"i"calt���examples���a, b, "c", "d", "e,f", g, hs���"c"s���"d"s���"e,f"t���gt���hs���a="b\"c", d="e\,f", g="h\\i"s���a="b"c"s���d="e,f"s���g="h\i"(���t���testsR���t���listR���t���assertEqualsR���t���parse_http_list(���R���R#���R"���R���(����(����R���t���test_parse_http_list,���s����W�(���t���__name__t ���__module__R���R&���(����(����(����R���R�������s��� t ���MockOpenerc�����������B���s#���t��Z�g��Z�d��d�„�Z�d�„��Z�RS(���Nc���������C���s���|�|�|��_��|��_�d��S(���N(���t���reqt���dataR���(���R���R*���R+���(����(����R���t���open7���s����c���������G���s���|�|�|��_��|��_�d��S(���N(���t���protot���argsR���(���R���R-���R.���(����(����R���t���error9���s����(���R'���R(���t ���addheaderst���NoneR,���R/���(����(����(����R���R)���5���s���t���MockFilec�����������B���s)���t��Z�d��d�„�Z�d��d�„�Z�d�„��Z�RS(���Nc���������C���s���d��S(���N(����(���R���t���count(����(����R���R���=���s����c���������C���s���d��S(���N(����(���R���R3���(����(����R���t���readline>���s����c���������C���s���d��S(���N(����(���R���(����(����R���R���?���s����(���R'���R(���R1���R���R4���R���(����(����(����R���R2���<���s���t���MockHeadersc�����������B���s���t��Z�d�„��Z�RS(���Nc���������C���s ���|��i�ƒ��S(���N(���R���t���values(���R���R���(����(����R���t ���getheadersB���s����(���R'���R(���R7���(����(����(����R���R5���A���s���t���MockResponsec�����������B���s&���t��Z�d��d�„�Z�d�„��Z�d�„��Z�RS(���Nc���������C���sA���t��i��i�|��|�ƒ�|�|�|�|�f�\�|��_�|��_�|��_�|��_�d��S(���N(���t���StringIOt���__init__R���R+���t���codet���msgt���headerst���url(���R���R;���R<���R=���R+���R>���(����(����R���R:���F���s����c���������C���s���|��i�S(���N(���R���R=���(���R���(����(����R���t���infoI���s����c���������C���s���|��i�S(���N(���R���R>���(���R���(����(����R���t���geturlK���s����(���R'���R(���R1���R:���R?���R@���(����(����(����R���R8���E���s��� t ���MockCookieJarc�����������B���s���t��Z�d�„��Z�d�„��Z�RS(���Nc���������C���s ���|�|��_�d��S(���N(���t���requestR���t���ach_req(���R���RB���(����(����R���t���add_cookie_headerO���s����c���������C���s���|�|�|��_�|��_�d��S(���N(���RB���t���responseR���t���ec_reqt���ec_r(���R���RE���RB���(����(����R���t���extract_cookiesQ���s����(���R'���R(���RD���RH���(����(����(����R���RA���N���s��� t ���FakeMethodc�����������B���s���t��Z�d�„��Z�d�„��Z�RS(���Nc���������C���s���|�|��_��|�|��_�|�|��_�d��S(���N(���t ���meth_nameR���t���handlet���action(���R���RJ���RL���RK���(����(����R���R:���U���s���� c���������G���s���|��i�|��i�|��i�|�Œ�S(���N(���R���RK���RJ���RL���R.���(���R���R.���(����(����R���t���__call__Y���s����(���R'���R(���R:���RM���(����(����(����R���RI���T���s��� t���MockHandlerc�����������B���sD���t��Z�d�Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�RS(���Niô��c���������C���s���|��i�|�ƒ�d��S(���N(���R���t���_define_methodst���methods(���R���RP���(����(����R���R:���^���s����c���������C���sm���xf�|�D]^�}�t�|�ƒ�d�j�o�|�\�}�}�n�|�d��}�}�t�|�|�|��i�ƒ�}�t �|��i�|�|�ƒ�q�Wd��S(���Ni���(���RP���t���spect���lenR���RL���R1���RI���R���RK���t���metht���setattrt ���__class__(���R���RP���R���RL���RS���RQ���(����(����R���RO���`���s������ c���������O���sI��|��i�i�i�|��|�|�|�f�ƒ�|�d��j�o�d��Sn|�d�j�o�|��Snï�|�d�j�o�t �d�d�h��d�ƒ�}�|�SnÅ�|�d�j�o�t�d�ƒ�Snª�|�i�d�ƒ�oy�|�|�i �d �ƒ�d �}�y�t�|�ƒ�}�Wn�t�j �o�n�Xt �d�d�h��d�ƒ�}�|��i�i�d�|�d�|�|�d�h��ƒ�Sn!�|�d �j�o�t�i�d�ƒ�‚�n�t�p�t�‚�d��S(���Ns���return selfs���return responseiÈ���t���OKt����s���return requests���http://blah/R/���t��� i���t���httpi����t���raiset���blah(���R���t���parentt���callst���appendt���fn_nameR.���t���kwdsRL���R1���R8���t���rest���Requestt ���startswitht���rfindR;���t���intR���R/���R���t���URLErrort���Falset���AssertionError(���R���R_���RL���R.���R`���R;���Ra���(����(����R���RK���f���s*���� ' c���������C���s���d��S(���N(����(���R���(����(����R���R���|���s����c���������C���s���|�|��_��g��|��i��_�d��S(���N(���R\���R���R]���(���R���R\���(����(����R���t ���add_parent}���s���� c���������C���s(���t��|�d�ƒ�p�t�Sn�|��i�|�i�j��S(���Nt ���handler_order(���t���hasattrt���othert���TrueR���Rj���(���R���Rl���(����(����R���t���__lt__€���s����( ���R'���R(���Rj���R:���RO���RK���R���Ri���Rn���(����(����(����R���RN���\���s��� c���������C���sƒ���g��}�d�}�xp�|�D]h�}�d�t�f�d�„��ƒ��Y}�|�|�ƒ�}�|�i�|�7_�|�i�|��ƒ�|�d�}�|�i �|�ƒ�|��i�|�ƒ�q�W|�S(���s¯��Create MockHandlers and add them to an OpenerDirector. meth_spec: list of lists of tuples and strings defining methods to define on handlers. eg: [["http_error", "ftp_open"], ["http_open"]] defines methods .http_error() and .ftp_open() on one handler, and .http_open() on another. These methods just record their arguments and return None. Using a tuple instead of a string causes the method to perform some action (see MockHandler.handle()), eg: [["http_error"], [("http_open", "return request")]] defines .http_error() on one handler (which simply returns None), and .http_open() on another handler, which returns a Request object. i����t���MockHandlerSubclassc�����������B���s���t��Z�RS(���N(���R'���R(���(����(����(����R���Ro���œ���s����i���N(���t���handlersR3���t ���meth_spect���methsRN���Ro���R!���Rj���Ri���t���openerR^���t���add_handler(���Rs���Rq���R3���Rp���R!���Rr���Ro���(����(����R���t���add_ordered_mock_handlers†���s������ t���OpenerDirectorTestsc�����������B���s5���t��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�RS(���Nc��� ������C���sí���t��ƒ��}�d�d�d�g�d�g�d�g�d �g�g�}�t�|�|�ƒ�}�t�d�ƒ�}�|�i�|�ƒ�} �|��i �| �|�d�ƒ�|�d�d�f�|�d�d�f�g�}�x[�t�|�|�i�ƒ�D]G�\�} �}�|�\�}�}�}�}�|��i �|�|�f�| �ƒ�|��i �|�|�f�ƒ�qž�Wd��S( ���Nt ���http_opent���ftp_opent���http_error_302s���return selfs���http://example.com/i���i����(���s ���http_opens���return self(���s ���http_opens���return self(���t���OpenerDirectort���oRq���Ru���Rp���Rb���R*���R,���t���rR���t���assertEqualR]���t���zipt���expectedt���gott���handlerR���R.���R`���( ���R���R.���R]���Rp���R���R*���R{���R`���Rq���R|���R���R€���R���(����(����R���t���test_handled§���s���� $ �c���������C���sÔ���t��ƒ��}�g��}�xq�d �g�d�f�d�g�d�f�g�D]Q�\�}�}�d�t�f�d�„��ƒ��Y}�|�|�ƒ�}�|�|�_�|�i�|�ƒ�|�i �|�ƒ�q.�W|�i �d�ƒ�}�|��i �|�i�d�d�|�d�ƒ�|��i �|�i�d�d�|�d�ƒ�d��S( ���NRw���s���return selfiô��i����Ro���c�����������B���s���t��Z�RS(���N(���R'���R(���(����(����(����R���Ro���È���s����s���http://example.com/i���(���s ���http_opens���return self(���Rz���R{���Rp���Rr���Rj���RN���Ro���R!���R^���Rt���R,���R|���R���R}���R]���(���R���Rj���Rp���R!���Rr���R{���Ro���R|���(����(����R���t���test_handler_orderÁ���s���� � c���������C���s|���t��ƒ��}�d�g�d�g�g�}�t�|�|�ƒ�}�t�d�ƒ�}�|��i�t �i �|�i�|�ƒ�|��i�|�i �|�d�d�|�f�h��f�g�ƒ�d��S(���NRw���RZ���s���return selfs���http://example.com/i����(���s ���http_opens���raise(���s ���http_opens���return self(���Rz���R{���Rq���Ru���Rp���Rb���R*���R���R���R���Rf���R,���R}���R]���(���R���Rp���R*���R{���Rq���(����(����R���t ���test_raiseÓ���s���� c��� ������C���s)��t��ƒ��}�d�g�d�d�g�d�d�d�g�d�g�g�} �t�|�| �ƒ�}�d �f��d �„��ƒ��Y}�t�d�ƒ�}�|�i�|�ƒ�} �t �|�i�ƒ�d�j�p�t�‚�|�d �d�|�f�f�|�d�d�|�|�ƒ��d�d�h��f�f�g�}�x]�t �|�|�i�ƒ�D]I�\�}�}�|�\�}�}�}�|��i�|�|�f�|�d� ƒ�|��i�|�|�d�ƒ�qØ�Wd��S(���NRw���s ���error 302t���http_error_400RZ���Ry���s���return responset���http_error_303t ���http_errort���Unknownc�����������B���s���t��Z�d�„��Z�RS(���Nc���������C���s���t��S(���N(���Rm���(���R���Rl���(����(����R���t���__eq__ò���s����(���R'���R(���R‰���(����(����(����R���Rˆ���ñ���s���s���http://example.com/i���i����i.��RW���(���s ���http_opens ���error 302(���R…���s���raise(���s���http_error_302s���return response(���Rz���R{���Rq���Ru���Rp���Rˆ���Rb���R*���R,���R|���RR���R]���Rh���R~���R���R€���R���t���method_nameR.���R���R}���( ���R���R.���R]���Rp���R���Rˆ���R*���R{���RŠ���Rq���R|���R���R€���(����(����R���t���test_http_errorä���s���� ';�c���������C���s…��t��ƒ��}�d �d �g�d�d�g�g�} �t�|�| �ƒ�}�t�d�ƒ�}�|�i�|�ƒ�} �|�d�d�f�|�d�d�f�|�d�d�f�|�d�d�f�g�}�xù�t �|�i �ƒ�D]è�\�}�\�}�}�}�}�|�d�j��oN�|��i�|�|�f�|�|�ƒ�|��i�t�|�ƒ�d�ƒ�|��i�t�|�d�t�ƒ�ƒ�q•�|��i�|�|�f�|�|�ƒ�|��i�t�|�ƒ�d�ƒ�|��i�t�|�d�t�ƒ�ƒ�|��i�|�d�d��j�p�t�|�d�t�ƒ�ƒ�q•�Wd��S( ���Nt���http_requests���return requestt ���http_responses���return responses���http://example.com/i����i���i���(���RŒ���s���return request(���R���s���return response(���RŒ���s���return request(���R���s���return response(���Rz���R{���Rq���Ru���Rp���Rb���R*���R,���R|���R]���t ���enumeratet���iR���R���R.���R`���R���R}���RR���t���assert_t ���isinstanceR1���R8���(���R���R.���R���R]���Rp���R���R���R*���R{���Rq���R|���R`���(����(����R���t���test_processorsÿ���s ���� :� (���R'���R(���R‚���Rƒ���R„���R‹���R’���(����(����(����R���Rv���¥���s ��� c���������C���sJ���d��k��}�|�i�|��ƒ�}�t�i�d�j�o�|�i�d�ƒ�o�|�d�}�n�|�S(���Nt���nts���///i���(���t���urllibt���pathname2urlR���t���urlpathR ���R���Rc���(���R���R”���R–���(����(����R���t���sanepathname2url#��s ���� t���HandlerTestsc�����������B���sk���t��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z �d �„��Z �d �„��Z�d�„��Z�RS(���Nc������ ������sÙ��d�f��d�„��ƒ��Y‰��d�t�i�f�‡��d�†��ƒ��Y}�d��k�}�d��k�} �d�}�|�|�ƒ�}�t�ƒ��} �|�_ �xod�d�|�i�d�d �d �g�d�d�f�d �d�d�d�d �d �g�d�d��f�d�d�|�i�d�g��d�d��f�g�D] \�}�}�}�}�}�}�} �|�i�t�|�ƒ�ƒ�}�|��i�|�i�|�i�j�o �d�j�n�ƒ�|��i�|�i�| �i�|�ƒ�ƒ�|��i�|�i�|�ƒ�|��i�|�i�|�ƒ�|��i�|�i�i�|�ƒ�|��i�|�i�i�|�ƒ�|�i�ƒ��}�|��i�|�i!�d�ƒ�| �ƒ�|��i�t"�|�d�ƒ�t#�|�ƒ�ƒ�qÄ�Wd��S(���Nt���MockFTPWrapperc�����������B���s���t��Z�d�„��Z�d�„��Z�RS(���Nc���������C���s ���|�|��_��d��S(���N(���R+���R���(���R���R+���(����(����R���R:���/��s����c���������C���s2���|�|�|��_��|��_�t�i�|��i�ƒ�t�|��i�ƒ�f�S(���N(���t���filenamet���filetypeR���R9���R+���RR���(���R���Rš���R›���(����(����R���t���retrfile0��s����(���R'���R(���R:���Rœ���(����(����(����R���R™���.��s��� t���NullFTPHandlerc��������������s���t��Z�d�„��Z�‡��d�†��Z�RS(���Nc���������C���s ���|�|��_��d��S(���N(���R+���R���(���R���R+���(����(����R���R:���5��s����c������������sH���|�|�|��_��|��_�|�|�|��_�|��_�|�|��_�ˆ��|��i�ƒ�|��_�|��i�S(���N( ���t���usert���passwdR���t���hostt���portt���dirsR™���R+���t ���ftpwrapper(���R���Rž���RŸ���R ���R¡���R¢���(���R™���(����R���t���connect_ftp6��s ���� (���R'���R(���R:���R¤���(����(���R™���(����R���R���4��s��� s���rheum rhaponicums ���ftp://localhost/foo/bar/baz.htmlt ���localhostt���It���foot���bars���baz.htmls ���text/htmls���ftp://localhost:80/foo/bar/iP���t���DRW���s���ftp://localhost/baz.gif;type=at���As���baz.gifs���Content-types���Content-length($���R™���R���t ���FTPHandlerR���t���ftplibt���socketR+���R!���R)���R{���R\���t���FTP_PORTR1���R>���R ���R¡���t���type_R¢���Rš���t���mimetypeRx���Rb���R|���R���R���Rž���RŸ���R}���t ���gethostbynameR£���R›���R?���R=���t���getRe���RR���(���R���R¡���R���Rš���R™���R¢���R¬���R ���R+���R°���R���R>���R!���R{���R=���R¯���R|���(����(���R™���R���t���test_ftp-��s$���� a�*c���������C���sé��d��k��}�d��k�}�d��k�} �t�i�ƒ��} �t�ƒ��}�| �_�t �i �} �t�t�i �i�| �ƒ�ƒ�}�d�}�xId�|�d�|�d�| �i�d�ƒ�|�f�d�| �i�| �i�ƒ��ƒ�|�f�g�D]}�t�| �d�ƒ�}�z�z�|�i�|�ƒ�Wd��|�i�ƒ��X| �i�t�|�ƒ�ƒ�}�z(�|�i�ƒ��}�|�i�ƒ��}�|�i�ƒ��}�Wd��|�i�ƒ��Xt�i!�| �ƒ�}�|�i#�|�i$�ƒ�}�Wd��t�i&�| �ƒ�X|��i(�|�|�ƒ�|��i(�|�d�d�ƒ�|��i(�|�d �d �ƒ�|��i(�|�d�|�ƒ�q¥�Wxw�d�|�g�D]h�}�zQ�t�| �d�ƒ�}�z�|�i�|�ƒ�Wd��|�i�ƒ��X|��i)�t�i*�| �i�t�|�ƒ�ƒ�Wd��t�i&�| �ƒ�Xq¸Wt�i�ƒ��} �t�ƒ��}�| �_�x¢�d �t+�f�d�t,�f�d�t,�f�g�D]�\�}�}�t�|�ƒ�}�y�| �i�|�ƒ�Wn*�t�i*�t/�f�j �o�|��i0�|�ƒ�qbX|��i0�|�i.�|�j�ƒ�|��i(�|�i1�d�ƒ�qbWd��S(���Ns ���hello, world s���file://localhost%ss ���file://%ss���file://%s%sR¥���t���wbs���Content-types ���text/plains���Content-lengtht���13s ���Last-modifieds���file://localhost:80%ss���file://ftp.example.com//foo.txts ���file://ftp.example.com///foo.txts���file://ftp.example.com/foo.txtt���ftp(2���t���timet���rfc822R���R���t���FileHandlerR!���R)���R{���R\���t���test_supportt���TESTFNR—���R ���R���R���R–���t���towriteR±���t���gethostnameR>���R,���R���t���writeR���t ���file_openRb���R|���R���R+���R?���R=���R@���t���newurlt���statt���statst ���formatdatet���st_mtimet���modifiedt���removeR���R}���R���Rf���Rm���Rg���R¶���R*���t���OSErrorR���t���type(���R���R¼���R–���R¶���RÂ���R*���RÀ���R¸���R+���R»���R���R���R>���R!���RÅ���R{���R=���R|���R·���(����(����R���t ���test_fileY��sh���� G�������"�c��� ���������sK��d�f��d�„��ƒ��Y‰��d�f��‡��d�†��ƒ��Y}�t�i�ƒ��}�t�ƒ��}�|�_�d�}�x@d�d�g�D]2\�}�} �t�|�| �h��d �d �<ƒ�}�|�i�d�d�ƒ�|�ƒ��}�|�i�|�|�ƒ�} �| �i�| �i�| �i�| �i�| �i�| �i�d �j�d�f�| �i�ƒ��}�|�i�|�i�|��i�| �i�ƒ��|�ƒ�|��i�|�i�d�ƒ�|��i�|�i�d�ƒ�|��i�|�i �|�ƒ�|��i�|�i�d�ƒ�|��i�|�i �d�d�d �g�ƒ�|��i�|�i�| �ƒ�qX�Wt!�|�_"�|��i#�t�i$�|�i�|�|�ƒ�d!�g�|�_%�x…d"�D]}} �t�d�| �ƒ�}�t&�d �d�h��d�ƒ�} �|�i'�|�ƒ�}�| �d��j�o0�|��i)�d�|�i*�j�ƒ�|��i)�d�|�i*�j�ƒ�n/�|��i�|�i*�d�d�ƒ�|��i�|�i*�d�d�ƒ�|��i�|�i*�d�d�ƒ�|��i�|�i*�d�d�ƒ�|�i�d�d�ƒ�|�i�d�d �ƒ�|�i�d�d�ƒ�|�i�d�d�ƒ�|�i'�|�ƒ�}�|��i�|�i*�d�d�ƒ�|��i�|�i*�d�d �ƒ�|��i�|�i*�d�d�ƒ�|��i�|�i*�d�d�ƒ�qÆWd��S(#���Nt���MockHTTPResponsec�����������B���s���t��Z�d�„��Z�d�„��Z�RS(���Nc���������C���s(���|�|��_��|�|��_�|�|��_�|�|��_�d��S(���N(���t���fpR���R<���t���statust���reason(���R���RË���R<���RÌ���RÍ���(����(����R���R:���®��s���� c���������C���s���d�S(���NRW���(����(���R���(����(����R���R���³��s����(���R'���R(���R:���R���(����(����(����R���RÊ�����s��� t ���MockHTTPClassc��������������s>���t��Z�d�„��Z�d�„��Z�d�„��Z�d��h��d�„�Z�‡��d�†��Z�RS(���Nc���������C���s���g��|��_�d��|��_�t�|��_�d��S(���N(���R���t���req_headersR1���R+���Rg���t���raise_on_endheaders(���R���(����(����R���R:���¶��s���� c���������C���s ���|�|��_��|��S(���N(���R ���R���(���R���R ���(����(����R���RM���º��s���� c���������C���s ���|�|��_��d��S(���N(���t���levelR���(���R���RÑ���(����(����R���t���set_debuglevel½��s����c���������C���so���|�|��_��|�|��_�|��i�|�i�ƒ��7_�|��i�i�ƒ��|�o �|�|��_ �n�|��i �o�d��k�}�|�i�ƒ��‚�n�d��S(���N( ���t���methodR���R>���t���selectorRÏ���R=���t���itemst���sortt���bodyR+���RÐ���R���R/���(���R���RÓ���R>���R×���R=���R���(����(����R���RB���¿��s���� c������������s���ˆ��t�ƒ��h��d�d�ƒ�S(���NiÈ���RV���(���RÊ���R2���(���R���(���RÊ���(����R���t���getresponseÉ��s����(���R'���R(���R:���RM���RÒ���R1���RB���RØ���(����(���RÊ���(����R���RÎ���µ��s ��� s���http://example.com/t���GETt���POSTR[���t���FooR¨���t���Spamt���eggsiÈ���RV���s���example.comi����R���t ���ConnectionR���RW���s���Content-lengths���Content-typet���0s!���application/x-www-form-urlencodedt���HostR§���t���baz(���RÙ���N(���RÚ���s���blah(���RÞ���s���close(���RÛ���s���bar(���RÜ���RÝ���(���RÜ���RÝ���(���RW���N(+���RÊ���RÎ���R���t���AbstractHTTPHandlerR!���R)���R{���R\���R>���R1���RÓ���R+���Rb���R*���t���add_unredirected_headerRY���t���do_openR|���R���R4���R?���R@���R;���R<���t���hdrsR²���t���has_keyR���R}���R ���RÑ���RÔ���RÏ���Rm���RÐ���R���Rf���R0���R8���t���do_request_t���newreqR���t���unredirected_hdrs( ���R���Rè���RY���Rå���R>���R!���R*���R{���RÊ���R|���R+���RÓ���RÎ���(����(���RÊ���R���t ���test_http¬��sb���� � � c���������C���sò���t��i�ƒ��}�t�ƒ��}�|�_�d�}�t�|�ƒ�}�t �d�d�h��d�|�ƒ�}�|�i�|�|�ƒ�}�|��i�|�|�j�ƒ�|��i�t�|�d�ƒ�ƒ�t �d�d�h��d�|�ƒ�}�|��i�|�i�|�|�ƒ�d��j�ƒ�|��i�|�i�d�ƒ�|��i�|�i�|�|�d�d�h��f�ƒ�d��S( ���Ns���http://example.com/iÈ���RV���RW���R-���iÉ���t���CreatedRY���(���R���t���HTTPErrorProcessorR!���R)���R{���R\���R>���Rb���R*���R8���R|���R���t���newrR���R���Rk���R1���R}���R-���R.���(���R���R>���R!���R*���R{���R|���Rí���(����(����R���t���test_errors��s����c���������C���sü���t��ƒ��}�t�i�|�ƒ�}�t�ƒ��}�|�_�t�d�ƒ�}�t �d�d�h��d�ƒ�}�|�i�|�ƒ�}�|��i�|�i�|�j�o �|�j�n�ƒ�|��i�|�i�ƒ��d�ƒ�|��i�|�i�ƒ��ƒ�|�i�|�|�ƒ�}�|��i�|�i�|�j�ƒ�|��i�|�i�|�j�o �|�j�n�ƒ�d��S(���Ns���http://example.com/iÈ���RV���RW���s���example.com(���RA���t���cjR���t���HTTPCookieProcessorR!���R)���R{���R\���Rb���R*���R8���R|���RŒ���Rè���R���R���RC���R$���t���get_origin_req_hostt���is_unverifiableR���Rí���RF���RG���(���R���Rï���Rè���R!���R*���R{���R|���Rí���(����(����R���t���test_cookies��s���� 'c���������C���sš��d�}�d�} �t�i�ƒ��}�t�ƒ��}�|�_�xud�D]m}�xdd�D]\}�t�|�d�|�ƒ�} �t �|�|�ƒ�}�|�i�d �d �ƒ�|�i�d�d�ƒ�y,�| �|�t�ƒ��|�d �t�h��d�| �<ƒ�ƒ�Wn6�t�i�j �o'�|��i�|�d�j�o �|�d��j �ƒ�n�X|��i�|�i�i�ƒ��| �ƒ�y�|��i�|�i�i�ƒ��d�ƒ�Wn*�t�j �o�|��i�|�i�i�ƒ��ƒ�n�X|��i�|�i�i�d �d �ƒ�|��i�d�|�i�i�j�ƒ�|��i�d�|�i�i�j�ƒ�q<�Wq/�Wt �|�ƒ�}�| �d�„�}�t �|�d�d�ƒ}�d�}�y&�x�|�|�|�d�ƒ�|�d�}�qÖWWn,�t�i�j �o�|��i�|�t�i�i�ƒ�n�Xt �|�d�d�ƒ}�d�}�y*�x#�|�|�|�d�|�ƒ�|�d�}�qCWWn,�t�i�j �o�|��i�|�t�i�i �ƒ�n�Xd��S(���Ns���http://example.com/a.htmls���http://example.com/b.htmli-��i.��i/��i3��s ���blah blah s ���http_error_%st���Nonsenses���viking=withholdRÜ���t���spamt���Blaht���locationRÙ���c������ ���C���s/���|��i�|�t�ƒ��d�d�t�h��d�|�<ƒ�ƒ�d��S(���Ni.��Rö���R÷���(���R!���Ry���R*���R2���R5���R>���(���R!���R*���R>���(����(����R���t���redirectF��s����t���origin_req_hosts���example.comi����i���s���http://example.com/s���http://example.com/%d(���i-��i.��i/��i3��(���Ns ���blah blah (!���t���from_urlt���to_urlR���t���HTTPRedirectHandlerR!���R)���R{���R\���R;���R1���R+���t���getattrRÓ���Rb���R*���t ���add_headerRã���R2���R5���t ���HTTPErrorR���R���R}���t���get_full_urlt ���get_methodt���AttributeErrort���has_dataR=���Ré���Rø���R3���t���max_repeatst���max_redirections(���R���Rø���R;���R3���R!���R*���R{���Rú���R+���RÓ���Rû���(����(����R���t ���test_redirect'��s^������%!���� c������ ���C���s��d�} �d�d�d�g�}�d�d�d�g�}�d�}�t�i�ƒ��}�t�ƒ��}�|�_ �t �| �ƒ�}�xS�|�D]K�} �| �d �|�}�|��i�t�i�|�i�|�t�ƒ��d �d�t�h��d�|�<ƒ�ƒ�qY�Wx`�|�D]X�} �| �d �|�}�|�i�|�t�ƒ��d �d �t�h��d�|�<ƒ�ƒ�|��i�|�i�i�ƒ��|�ƒ�q¯�Wd��S(���Ns���http://example.com/a.htmlRY���t���httpsR¶���t���filet���imapt���ldaps���example.com/b.htmls���://i.��s���Security LoopholeR÷���s���That's fine(���Rú���t ���valid_schemest���invalid_schemest���schemeless_urlR���Rü���R!���R)���R{���R\���Rb���R*���t���schemet���invalid_urlR���R���Rÿ���Ry���R2���R5���t ���valid_urlR}���R���(���R���R��R!���R��R*���R{���R��R ��R��Rú���R��(����(����R���t���test_invalid_redirectb��s&������c���������C���sº���d�t��i�f�d�„��ƒ��Y} �d�k�l�}�d�k��l�}�l�}�l�} �l�}�d�k�l �}�|�ƒ��}�|�|�d�d�ƒ�| �ƒ��}�|�|�ƒ�}�|�|�|�ƒ�}�|�i�d�ƒ�|��i�|�i�i�d�ƒ�ƒ�d��S( ���Nt���MockHTTPHandlerc�����������B���s���t��Z�d�„��Z�d�„��Z�RS(���Nc���������C���s ���d�|��_�d��S(���Ni����(���R���t���_count(���R���(����(����R���R:���x��s����c���������C���s¯���d��k��}�d�k�l�}�|��i�d�j�oK�|��i�d�|��_�|�i�|�d�ƒ�ƒ�}�|��i�i�d�|�t �ƒ��d�d�|�ƒ�Sn;�|�|��_�|�i�|�d�ƒ�ƒ�}�t �d �d �|�d�|�i�ƒ��ƒ�Sd��S(���N(���s���StringIOi����i���s%���Location: http://www.cracker.com/ RY���i.��t���Founds��� iÈ���RV���RW���(���t ���mimetoolsR9���R���R��t���MessageR<���R\���R/���R*���R2���R8���R���(���R���R*���R��R9���R<���(����(����R���Rw���y��s���� & (���R'���R(���R:���Rw���(����(����(����R���R��w��s��� (���s ���CookieJar(���s���build_openers���HTTPHandlers ���HTTPErrors���HTTPCookieProcessor(���s���interact_netscapes���http://www.example.com/s ���spam=eggst���Cookie(���R���t���HTTPHandlerR��t ���cookielibt ���CookieJart���build_openerRÿ���Rð���t���test_cookielibt���interact_netscapeRï���t���hht���cpR{���R,���R���R���R*���t ���has_header(���R���Rï���R��R��R��R{���Rð���R��R��Rÿ���R��R��(����(����R���t���test_cookie_redirectv��s���� c��� ������C���sÖ���t��ƒ��}�t�i�t�d�d�ƒ�ƒ�}�|�i�|�ƒ�d �g�g�}�t�|�|�ƒ�}�t �d�ƒ�}�|��i �|�i�ƒ��d�ƒ�|�i�|�ƒ�}�|��i �|�i�ƒ��d�ƒ�|��i �|�d�d�f�g�g��}�|�i�D]�}�|�|�d�d�!q´�~�ƒ�d��S( ���NRY���s���proxy.example.com:3128Rw���s���return responses���http://acme.example.com/s���acme.example.comi����i���(���s ���http_opens���return response(���Rz���R{���R���t���ProxyHandlert���dictt���phRt���Rq���Ru���Rp���Rb���R*���R���R}���t���get_hostR,���R|���t���_[1]R]���t���tup( ���R���Rp���R'��R*���R{���R&��Rq���R|���R$��(����(����R���t ���test_proxy•��s���� c���������C���s×���d�t��i�d�<t�ƒ��}�t�i�t�d�d�ƒ�ƒ�}�|�i�|�ƒ�t �d�ƒ�}�|��i�|�i �ƒ��d�ƒ�|�i�|�ƒ�}�|��i�|�i �ƒ��d�ƒ�t �d�ƒ�}�|��i�|�i �ƒ��d�ƒ�|�i�|�ƒ�}�|��i�|�i �ƒ��d�ƒ�t��i�d�=d��S( ���Ns ���python.orgt���no_proxyRY���s���proxy.example.coms���http://www.perl.org/s���www.perl.orgs���http://www.python.orgs���www.python.org(���R ���t���environRz���R{���R���R"��R#��R$��Rt���Rb���R*���R���R}���R%��R,���R|���(���R���R*���R{���R|���R$��(����(����R���t���test_proxy_no_proxy¦��s���� c��� ������C���sÖ���t��ƒ��}�t�i�t�d�d�ƒ�ƒ�}�|�i�|�ƒ�d �g�g�}�t�|�|�ƒ�}�t �d�ƒ�}�|��i �|�i�ƒ��d�ƒ�|�i�|�ƒ�}�|��i �|�i�ƒ��d�ƒ�|��i �|�d�d�f�g�g��}�|�i�D]�}�|�|�d�d�!q´�~�ƒ�d��S( ���NR��s���proxy.example.com:3128t ���https_opens���return responses���https://www.example.com/s���www.example.comi����i���(���R,��s���return response(���Rz���R{���R���R"��R#��R$��Rt���Rq���Ru���Rp���Rb���R*���R���R}���R%��R,���R|���R&��R]���R'��( ���R���Rp���R'��R*���R{���R&��Rq���R|���R$��(����(����R���t���test_proxy_https¶��s���� ( ���R'���R(���R³���RÉ���Rê���Rî���Ró���R��R��R!��R(��R+��R-��(����(����(����R���R˜���+��s��� , S [ ; t ���MiscTestsc�����������B���s���t��Z�d�„��Z�d�„��Z�RS(���Nc���������C���s8��d�t��i�f�d�„��ƒ��Y}�d�t��i�f�d�„��ƒ��Y}�d�t��i�f�d�„��ƒ��Y}�t��i�}�|�|�|�ƒ�}�|��i �|�|�ƒ�|��i �|�|�ƒ�|�|�|�ƒ��ƒ�}�|��i �|�|�ƒ�|��i �|�|�ƒ�|�|�ƒ�}�|��i �|�|�ƒ�|�ƒ��}�|��i �|�t��i�ƒ�|�t��i�ƒ�}�|��i �|�t��i�ƒ�|�t��i�ƒ��ƒ�}�|��i �|�t��i�ƒ�d��S(���Nt ���MyHTTPHandlerc�����������B���s���t��Z�RS(���N(���R'���R(���(����(����(����R���R/��É��s����t ���FooHandlerc�����������B���s���t��Z�d�„��Z�RS(���Nc���������C���s���d��S(���N(����(���R���(����(����R���t���foo_openË��s����(���R'���R(���R1��(����(����(����R���R0��Ê��s���t ���BarHandlerc�����������B���s���t��Z�d�„��Z�RS(���Nc���������C���s���d��S(���N(����(���R���(����(����R���t���bar_openÍ��s����(���R'���R(���R3��(����(����(����R���R2��Ì��s���( ���R���R��R/��t���BaseHandlerR0��R2��R��R{���R���t���opener_has_handler(���R���R��R0��R{���R/��R2��(����(����R���t���test_build_openerÈ��s$���� c���������C���s:���x3�|�i�D]�}�|�i�|�j�o�Pq �q �W|��i�t�ƒ�d��S(���N(���Rs���Rp���R!���RU���t ���handler_classR���R���Rg���(���R���Rs���R7��R!���(����(����R���R5��ç��s ���� � (���R'���R(���R6��R5��(����(����(����R���R.��Æ��s��� t���NetworkTestsc�����������B���sP���t��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z�d�„��Z �RS( ���Nc���������C���s���d��S(���N(����(���R���(����(����R���t���setUpï��s����c���������C���sS���t��i�d�d�h��d�d�<ƒ}�t��i�|�ƒ�}�|�i�ƒ��}�|��i�t �|�ƒ�d�ƒ�d��S(���Ns���http://www.python.orgR=���t���Ranges���bytes=20-39i���( ���R���Rb���R*���R ���t���resultR���R+���R���R}���RR���(���R���R*���R;��R+���(����(����R���t ���test_rangeõ��s ���� c���������C���s)���d�d�d�g�}�|��i�|�|��i�ƒ��ƒ�d��S(���Ns-���ftp://www.python.org/pub/python/misc/sousa.aus!���ftp://www.python.org/pub/tmp/blats[���ftp://gatekeeper.research.compaq.com/pub/DEC/SRC/research-reports/00README-Legal-Rules-Regs(���t���urlsR���t ���_test_urlst���_extra_handlers(���R���R=��(����(����R���R³���ÿ��s����c���������C���s&���d�d�g�}�|��i�|�|��i�ƒ��ƒ�d��S(���Ns3���gopher://gopher.lib.ncsu.edu/11/library/stacks/Alexs"���gopher://gopher.vt.edu:10010/10/33(���R=��R���R>��R?��(���R���R=��(����(����R���t���test_gopher��s����c���������C���s’���t��i�}�t�|�d�ƒ�}�ze�|�i�d�ƒ�|�i�ƒ��d�t�t�i�i �|�ƒ�ƒ�d�d��t�t�i �f�f�g�}�|��i�|�|��i�ƒ��ƒ�Wd��t�i�|�ƒ�Xd��S(���Nt���ws ���hi there s���file:s���file://nonsensename/etc/passwd(���Rº���R»���R,���R���R¾���R���R—���R ���R���R���R1���RÇ���R���R/���R=��R���R>��R?��RÆ���(���R���R���R=��R»���(����(����R���RÉ�����s���� 4�c���������C���s,���d�d�d�d�g�}�|��i�|�|��i�ƒ��ƒ�d��S(���Ns���http://www.espn.com/s)���http://www.python.org/Spanish/Inquistion/s%���http://www.python.org/cgi-bin/faqw.pys:���query=pythonistas&querytype=simple&casefold=yes&req=searchs���http://www.python.org/(���s%���http://www.python.org/cgi-bin/faqw.pys:���query=pythonistas&querytype=simple&casefold=yes&req=searchN(���R1���R=��R���R>��R?��(���R���R=��(����(����R���Rê���!��s����c��� ������C���s5��d��k��}�d��k�} �d��k�}�|�i�d�ƒ�i�}�t�i�t�i�|�Œ��ƒ�xë�|�D]ã�}�t�|�t�ƒ�o�|�\�}�}�}�n�d��}�}�|�|�ƒ�y�t�i�|�|�ƒ�}�WnL�t�|�i�t�f�j �o4�} �|�| �ƒ�|�o�|��i�t�| �|�ƒ�ƒ�qn,�X|�i�ƒ��}�|�i�ƒ��|�d�t�|�ƒ�ƒ�|�d�ƒ�| �i�d�ƒ�qJ�Wd��S(���Nt���test_urllib2s ���read %d bytess���******** next url coming up...f0.10000000000000001(���R���R·���t���loggingt ���getLoggert���debugR���t���install_openerR��Rp���R=��R>���R‘���t���tupleR*���t���expected_errR1���R ���R���t���IOErrorR/���RÇ���t���errR���R���R���R���R���RR���t���sleep( ���R���R=��Rp���RH��R*���RC��R���R���R>���RJ��R·���RE��R���(����(����R���R>��G��s,���� � c���������C���s@���g��}�|�i�t�i�ƒ�t�i�ƒ��}�|�i�d�ƒ�|�i�|�ƒ�|�S(���Ni���(���Rp���R^���R���t ���GopherHandlert���CacheFTPHandlert���cfht ���setTimeout(���R���RN��Rp���(����(����R���R?��b��s���� ( ���R'���R(���R9��R<��R³���R@��RÉ���Rê���R>��R?��(����(����(����R���R8��î��s��� & c���������C���sT���t��i�t�|��ƒ�t�t�t�t�f�}�t��i �d�ƒ�o�|�t �f�7}�n�t��i�|�Œ��d��S(���Nt���network(���Rº���t���run_doctestR���t���verboseR����Rv���R˜���R.��R"���t���is_resource_enabledR8��t���run_unittest(���RR��R"���(����(����R���t ���test_mainx��s ����t���__main__RR��(���t���unittestt���testRº���R ���R���R9���R���Rb���Rz���t���TestCaseR����R)���R2���R#��R5���R8���RA���RI���RN���Ru���Rv���R—���R˜���R.��R8��R1���RU��R'���Rm���(���Rº���R8��RW��R5���Rv���R8���RI���RA���R˜���RU��RN���Rb���R���R2���Rz���R—���Ru���R���R����R9���R.��R)���R ���(����(����R���t���?���s.��� " * ~ ÿ�œ(Š