Skip to content
Myr

test_requests_ext.py

This file

Path

test_requests_ext.py

45 lines · 963 bytes · Python

Last changed by

Merge branch 'develop' of github.com:kennethreitz/requests into developKenneth Reitzbefore adoption6db255d

History of this file

Take it

1#!/usr/bin/env python2# -*- coding: utf-8 -*-34from __future__ import with_statement56import unittest78import requests910try:11    import omnijson as json12except ImportError:13    import json141516class RequestsTestSuite(unittest.TestCase):17    """Requests test cases."""1819    # It goes to eleven.20    _multiprocess_can_split_ = True2122    def test_addition(self):23        assert (1 + 1) == 22425    def test_ssl_hostname_ok(self):26        requests.get('https://github.com', verify=True)2728    def test_ssl_hostname_not_ok(self):29        requests.get('https://kennethreitz.com', verify=False)3031        self.assertRaises(requests.exceptions.SSLError, requests.get, 'https://kennethreitz.com')3233    def test_ssl_hostname_session_not_ok(self):3435        s = requests.session()3637        self.assertRaises(requests.exceptions.SSLError, s.get, 'https://kennethreitz.com')3839        s.get('https://kennethreitz.com', verify=False)40414243if __name__ == '__main__':44    unittest.main()45