Skip to content
Myr

Add a smoke test for https functionality

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Shivaram Lingamneni · committed by Shivaram Lingamneni · parent 9921099 · Browse files · 1 file+31 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+31 added−0 removed

  • tests:+31 added−0 removed

1 file+31 added−0 removed

added:tests/test_requests_https.py+31 added
1#!/usr/bin/env python2# -*- 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()