Skip to content

Commit

Permalink
testing requests with poster and adding headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed Mar 6, 2011
1 parent 9fdee25 commit e17111a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test_requests.py
Expand Up @@ -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)
Expand Down

0 comments on commit e17111a

Please sign in to comment.