diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:22 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:22 -0700 |
commit | 3a4ef8165fb2951781a7bcc4189e90faf26caf2d (patch) | |
tree | 5223d80835a57dad6b7b6e0c37f689441ccb4e1e /tests/test_requests_https.py | |
parent | 40337989ba5056432c9f2af3c42267e5ee9e3e18 (diff) | |
download | python-requests-3a4ef8165fb2951781a7bcc4189e90faf26caf2d.tar python-requests-3a4ef8165fb2951781a7bcc4189e90faf26caf2d.tar.gz |
Imported Upstream version 0.11.2
Diffstat (limited to 'tests/test_requests_https.py')
-rwxr-xr-x | tests/test_requests_https.py | 31 |
1 files changed, 31 insertions, 0 deletions
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() |