__init__.py 1.1 KB

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