File: __init__.py

package info (click to toggle)
ndg-httpsclient 0.5.1-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248 kB
  • sloc: python: 1,083; makefile: 29; sh: 1
file content (31 lines) | stat: -rw-r--r-- 1,139 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Unit tests package for ndg_httpsclient

PyOpenSSL utility to make a httplib-like interface suitable for use with 
urllib2
"""
__author__ = "P J Kershaw (STFC)"
__date__ = "05/01/12"
__copyright__ = "(C) 2012 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revision__ = '$Id$'
import os
import unittest
    
class Constants(object):
    '''Convenience base class from which other unit tests can extend.  Its
    sets the generic data directory path'''
    PORT = 4443
#     PORT = 443
    PORT2 = 4444
    HOSTNAME = 'localhost'
#    HOSTNAME = 'files.pythonhosted.org'
    TEST_URI = 'https://%s:%d' % (HOSTNAME, PORT)
    TEST_URI2 = 'https://%s:%d' % (HOSTNAME, PORT2)
    
    UNITTEST_DIR = os.path.dirname(os.path.abspath(__file__))
    CACERT_DIR = os.path.join(UNITTEST_DIR, 'pki', 'ca')
    SSL_CERT_FILENAME = 'localhost.crt'
    SSL_CERT_FILEPATH = os.path.join(UNITTEST_DIR, 'pki', SSL_CERT_FILENAME)
    SSL_PRIKEY_FILENAME = 'localhost.key'
    SSL_PRIKEY_FILEPATH = os.path.join(UNITTEST_DIR, 'pki', SSL_PRIKEY_FILENAME)