• File: test_urllib2.pyo
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyo
  • Date Modified: 10/31/2014 10:04 AM
  • File size: 2.78 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

:Oc@sdZdZdZdZdZdZdZddlmZdd	l	Z	dd
l
mZddlm
Z
ddlmZd
e	jfdYZedkre	jnd	S(sunit 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(tbuild_openertUrllib2TestCasecBs2eZdZdZdZdZdZRS(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|jGHdS(Nsres = %s(RtopenRtTEST_URIRtread(RRtres((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyttest02_opens	
cCs&t}|jt|jtjdS(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||jddtd|}|jtj	|j
tjdS(NcSs|S(N((tconntx509terrnumterrdepthtpreverify_ok((sE/usr/lib/python2.7/site-packages/ndg/httpsclient/test/test_urllib2.pyt<lambda>(ss./tssl_context(
RtContexttSSLv3_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