test_requests_https.py
This file
Path
tests/test_requests_https.py
32 lines · 742 bytes · Python
Last changed by
Merge pull request #786 from Locker537/lint_fixKenneth Reitzbefore adoption27f34a5
History of this fileTake it
The walk stopped after 200 commits: lines older than 742cbea point at it.
httpbin weirdnessKenneth Reitzbefore adoption742cbea
lines 1–11why, one step back1#!/usr/bin/env python2# -*- coding: utf-8 -*-34import sys, os5import json6import unittest78# Path hack.9sys.path.insert(0, os.path.abspath('..'))10import requests11Merge pull request #786 from Locker537/lint_fixKenneth Reitzbefore adoption27f34a5
line 12why, one step back12httpbin weirdnessKenneth Reitzbefore adoption742cbea
lines 13–32why, one step back13class 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()