Skip to content
Myr

a few test fixtures for now

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent fdd54e1 · Browse files · 1 file+38 added−2 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+38 added−2 removed

  • other:+38 added−2 removed

1 file+38 added−2 removed

modified:test_requests.py+38 added-2 removed
3 unmodified lines
4import unittest56import requests78print requests.get('http://kennethreitz.com').headers89class RequestsTestSuite(unittest.TestCase):10 """Requests test cases."""11 12 def setUp(self):13 pass1411r = requests.Request()15 def tearDown(self):16 """Teardown."""17 pass18 19 def test_invalid_url(self):20 self.assertRaises(ValueError, requests.get, 'hiwpefhipowhefopw')2122 def test_HTTP_200_OK_GET(self):23 r = requests.get('http://google.com')24 self.assertEqual(r.status_code, 200)2526 def test_HTTPS_200_OK_GET(self):27 r = requests.get('https://google.com')28 self.assertEqual(r.status_code, 200)2930 def test_HTTP_200_OK_HEAD(self):31 r = requests.head('http://google.com')32 self.assertEqual(r.status_code, 200)3334 def test_HTTPS_200_OK_HEAD(self):35 r = requests.head('https://google.com')36 self.assertEqual(r.status_code, 200)3738 def test_AUTH_HTTPS_200_OK_GET(self):39 auth = requests.AuthObject('requeststest', 'requeststest')40 url = 'https://convore.com/api/account/verify.json'41 r = requests.get(url, auth=auth)4243 self.assertEqual(r.status_code, 200)444546if __name__ == '__main__':47 unittest.main()