From: Shivaram Lingamneni Date: Mon, 16 Apr 2012 22:42:14 +0000 (-0700) Subject: Add a smoke test for https functionality X-Git-Tag: v0.12.0~49^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1360e77cb2c5c7956b9c2b6e510040fa73c6d7ee;p=services%2Fpython-requests.git Add a smoke test for https functionality --- diff --git a/tests/test_requests_https.py b/tests/test_requests_https.py new file mode 100755 index 0000000..c6ea8f3 --- /dev/null +++ b/tests/test_requests_https.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys, os +import json +import unittest + +# Path hack. +sys.path.insert(0, os.path.abspath('..')) +import requests + +class HTTPSTest(unittest.TestCase): + """Smoke test for https functionality.""" + + smoke_url = "https://github.com" + + def perform_smoke_test(self, verify=False): + result = requests.get(self.smoke_url, verify=verify) + self.assertEqual(result.status_code, 200) + + def test_smoke(self): + """Smoke test without verification.""" + self.perform_smoke_test(verify=False) + + def test_smoke_verified(self): + """Smoke test with SSL verification.""" + self.perform_smoke_test(verify=True) + + +if __name__ == '__main__': + unittest.main()