test_https.py 569 B

123456789101112131415161718192021222324252627
  1. '''
  2. Created on Jan 6, 2012
  3. @author: philipkershaw
  4. '''
  5. import logging
  6. logging.basicConfig(level=logging.DEBUG)
  7. import unittest
  8. from ndg.httpsclient.test import Constants
  9. from ndg.httpsclient.https import HTTPSConnection
  10. class TestHTTPSConnection(unittest.TestCase):
  11. def test01(self):
  12. conn = HTTPSConnection(Constants.HOSTNAME, port=Constants.PORT)
  13. conn.connect()
  14. conn.request('GET', '/')
  15. resp = conn.getresponse()
  16. print('Response = %s' % resp.read())
  17. conn.close()
  18. if __name__ == "__main__":
  19. unittest.main()