Spade
Mini Shell
| Directory:~$ /proc/self/root/usr/lib/python2.7/site-packages/ndg/httpsclient/test/ |
| [Home] [System Details] [Kill Me] |
�
�:Oc@s�dZdZdZdZdZdZdZddlmZdd l Z dd
l
mZddlm
Z
ddlmZd
e jfd��YZedkr�e j�nd S(s�unit
tests module for ndg.httpsclient.urllib2_build_opener module
PyOpenSSL utility to make a httplib-like interface suitable for use with
urllib2
sP J Kershaw (STFC)s06/01/12s2(C) 2012 Science and Technology Facilities
Councils-BSD - see LICENSE file in top-level
directorysPhilip.Kershaw@stfc.ac.uks$Id$i����(tURLErrorN(tSSL(t Constants(tbuild_openertUrllib2TestCasecBs2eZdZd�Zd�Zd�Zd�ZRS(s$Unit
tests for urllib2
functionalitycCst�}|j|�dS(N(Rtassert_(tselftopener((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyttest01_urllib2_build_openers cCs;t�}|jtj�}|j|�d|j�GHdS(Nsres
=
%s(RtopenRtTEST_URIRtread(RRtres((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyttest02_opens
cCs&t�}|jt|jtj�dS(N(RtfailUnlessRaisesRR Rt TEST_URI2(RR((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyttest03_open_fails_unknown_loc!s cCsmtjtj�}d�}|jtj|�|jdd�td|�}|jtj |j
tj�dS(NcSs|S(N((tconntx509terrnumterrdepthtpreverify_ok((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyt<lambda>(ss./tssl_context(
RtContexttSSLv3_METHODt
set_verifytVERIFY_PEERtload_verify_locationstNoneRRtErrorR RR
(Rtctxtverify_callbackR((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyt(test04_open_peer_cert_verification_fails%s (t__name__t
__module__t__doc__RR
RR!(((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyRs
t__main__(R$t
__author__t__date__t
__copyright__t__license__t__contact__t__revision__turllib2RtunittesttOpenSSLRtndg.httpsclient.testRt$ndg.httpsclient.urllib2_build_openerRtTestCaseRR"tmain(((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyt<module>s