Package ndg :: Package httpsclient :: Package test
[hide private]

Source Code for Package ndg.httpsclient.test

 1  """Unit tests package for ndg_httpsclient 
 2   
 3  PyOpenSSL utility to make a httplib-like interface suitable for use with  
 4  urllib2 
 5  """ 
 6  __author__ = "P J Kershaw (STFC)" 
 7  __date__ = "05/01/12" 
 8  __copyright__ = "(C) 2012 Science and Technology Facilities Council" 
 9  __license__ = "BSD - see LICENSE file in top-level directory" 
10  __contact__ = "Philip.Kershaw@stfc.ac.uk" 
11  __revision__ = '$Id$' 
12  import os 
13  import unittest 
14       
15 -class Constants(object):
16 '''Convenience base class from which other unit tests can extend. Its 17 sets the generic data directory path''' 18 PORT = 4443 19 PORT2 = 4444 20 HOSTNAME = 'localhost' 21 TEST_URI = 'https://%s:%d' % (HOSTNAME, PORT) 22 TEST_URI2 = 'https://%s:%d' % (HOSTNAME, PORT2) 23 24 UNITTEST_DIR = os.path.dirname(os.path.abspath(__file__)) 25 CACERT_DIR = os.path.join(UNITTEST_DIR, 'pki', 'ca') 26 SSL_CERT_FILENAME = 'localhost.crt' 27 SSL_CERT_FILEPATH = os.path.join(UNITTEST_DIR, 'pki', SSL_CERT_FILENAME) 28 SSL_PRIKEY_FILENAME = 'localhost.key' 29 SSL_PRIKEY_FILEPATH = os.path.join(UNITTEST_DIR, 'pki', SSL_PRIKEY_FILENAME)
30