Skip to content
Myr

test_requests_https.py

This file

Path

tests/test_requests_https.py

31 lines · 741 bytes · Python

Last changed by

Merge pull request #552 from slingamn/bundle_2Kenneth Reitzbefore adoption1631f0f

History of this file

Take it

Merge pull request #552 from slingamn/bundle_2Kenneth Reitzbefore adoption1631f0f

lines 1–31why, one step back
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-34import sys, os5import json6import unittest78# Path hack.9sys.path.insert(0, os.path.abspath('..'))10import requests1112class HTTPSTest(unittest.TestCase):13 """Smoke test for https functionality."""1415 smoke_url = "https://github.com"1617 def perform_smoke_test(self, verify=False):18 result = requests.get(self.smoke_url, verify=verify)19 self.assertEqual(result.status_code, 200)2021 def test_smoke(self):22 """Smoke test without verification."""23 self.perform_smoke_test(verify=False)2425 def test_smoke_verified(self):26 """Smoke test with SSL verification."""27 self.perform_smoke_test(verify=True)282930if __name__ == '__main__':31 unittest.main()