Permalink
Browse files

testing requests with poster and adding headers

  • Loading branch information...
1 parent 9fdee25 commit e17111a5dd3049a614cbb2ad2db2bf1c4f72edfd @kennethreitz kennethreitz committed Mar 6, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 test_requests.py
View
@@ -84,6 +84,17 @@ def test_POSTBIN_GET_POST_FILES_WITH_PARAMS(self):
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)

0 comments on commit e17111a

Please sign in to comment.