HEX
Server: nginx/1.30.4
System: Linux d-twindigital-web-1.host-ed.eu 4.18.0-553.141.2.el8_10.x86_64 #1 SMP Wed Jul 8 10:28:18 EDT 2026 x86_64
User: u_twindigital_html (1009)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/ndg/httpsclient/test/__pycache__/test_utils.cpython-36.pyc
3

��Z8�@s�dZdZdZdZdZdZdZddlZddlZdd	l	m
Z
dd
lmZddl
mZmZmZmZGdd
�d
ej�Zedkr~ej�dS)z�unit tests module for ndg.httpsclient.utils module

PyOpenSSL utility to make a httplib-like interface suitable for use with 
urllib2
zP J Kershaw (STFC)z06/01/12z2(C) 2012 Science and Technology Facilities Councilz-BSD - see LICENSE file in top-level directoryzPhilip.Kershaw@stfc.ac.ukz$Id$�N)�SSL)�	Constants)�
Configuration�fetch_from_url�open_url�_should_use_proxyc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�TestUtilsModulez!Test ndg.httpsclient.utils modulecCs0ttjtj�d�}|j|j�|j|jd�dS)NT)rr�Context�TLSv1_2_METHOD�
assertTrueZssl_context�assertEqual�debug)�self�config�r� /usr/lib/python3.6/test_utils.py�test01_configurationsz$TestUtilsModule.test01_configurationcCs,ttjtj�d�}ttj|�}|j|�dS)NT)rrr	r
rr�TEST_URIr)rr�resrrr�test02_fetch_from_urlsz%TestUtilsModule.test02_fetch_from_urlcCs:ttjtj�d�}ttj|�}|j|dddtj�dS)NTr��zopen_url for %r failed)rrr	r
rrrr)rrrrrr�test03_open_url#szTestUtilsModule.test03_open_urlcCspdtjkrtjd}tjd=nd}|jttj�d�dtjd<|jttj�d�|dk	rd|tjd<ntjd=dS)N�no_proxyzExpecting use proxy = Truezlocalhost,localhost.localdomainzExpecting use proxy = False)�os�environrrrrZassertFalse)rrrrr�test04__should_use_proxy)s



z(TestUtilsModule.test04__should_use_proxyN)�__name__�
__module__�__qualname__�__doc__rrrrrrrrrs
r�__main__)r�
__author__Z__date__Z
__copyright__Z__license__Z__contact__Z__revision__ZunittestrZOpenSSLrZndg.httpsclient.testrZndg.httpsclient.utilsrrrrZTestCaserr�mainrrrr�<module>s'