test_requests_https.py
This file
Path
tests/test_requests_https.py
32 lines · 736 bytes · Python
Last changed by
Merge remote-tracking branch 'origin/develop' into developKenneth Reitzbefore adoptiona74c6c6
History of this fileTake it
1#!/usr/bin/env python2# -*- coding: utf-8 -*-34import os5import sys6import unittest78# Path hack.9sys.path.insert(0, os.path.abspath('..'))10import requests111213class HTTPSTest(unittest.TestCase):14 """Smoke test for https functionality."""1516 smoke_url = "https://github.com"1718 def perform_smoke_test(self, verify=False):19 result = requests.get(self.smoke_url, verify=verify)20 self.assertEqual(result.status_code, 200)2122 def test_smoke(self):23 """Smoke test without verification."""24 self.perform_smoke_test(verify=False)2526 def test_smoke_verified(self):27 """Smoke test with SSL verification."""28 self.perform_smoke_test(verify=True)293031if __name__ == '__main__':32 unittest.main()