From e17111a5dd3049a614cbb2ad2db2bf1c4f72edfd Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 6 Mar 2011 18:50:28 -0500 Subject: [PATCH] testing requests with poster and adding headers --- test_requests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test_requests.py b/test_requests.py index 22716f1..177ed9f 100644 --- a/test_requests.py +++ b/test_requests.py @@ -84,6 +84,17 @@ class RequestsTestSuite(unittest.TestCase): post2 = requests.post(bin.url, files={'some': open('test_requests.py')}, data={'some': 'data'}) self.assertEqual(post2.status_code, 201) + + def test_POSTBIN_GET_POST_FILES_WITH_HEADERS(self): + + bin = requests.post('http://www.postbin.org/') + self.assertEqual(bin.status_code, 200) + + post2 = requests.post(bin.url, files={'some': open('test_requests.py')}, + headers={'User-Agent': 'requests-tests'}) + + self.assertEqual(post2.status_code, 201) + def test_nonzero_evaluation(self): r = requests.get('http://google.com/some-404-url') self.assertEqual(bool(r), False) -- 2.7.4