postbin tests were broken

This commit is contained in:
Kenneth Reitz
2011-02-25 08:00:23 -05:00
parent b252cd8403
commit 839c8cf150
+13 -19
View File
@@ -63,31 +63,25 @@ class RequestsTestSuite(unittest.TestCase):
requests.auth_manager.empty()
def test_POSTBIN_GET_POST_FILES(self):
h = {'Content-type': 'application/x-www-form-urlencoded'}
bin = requests.post('http://www.postbin.org/', headers=h)
# self.assertEqual(bin.status_code, 200)
bin = requests.post('http://www.postbin.org/')
print bin.url
print bin.status_code
# post = requests.post(bin.url, data={'some': 'data'})
# self.assertEqual(post.status_code, 200)
# post2 = requests.post(bin.url, files={'some': open('test_requests.py')})
# self.assertEqual(post2.status_code, 200)
self.assertEqual(bin.status_code, 200)
post = requests.post(bin.url, data={'some': 'data'})
self.assertEqual(post.status_code, 201)
post2 = requests.post(bin.url, files={'some': open('test_requests.py')})
self.assertEqual(post2.status_code, 201)
def test_POSTBIN_GET_POST_FILES_WITH_PARAMS(self):
# TODO: postbin w/ params
bin = requests.get('http://www.postbin.org/')
bin = requests.post('http://www.postbin.org/')
print bin.url
self.assertEqual(bin.status_code, 200)
post = requests.post(bin.url, data={'some': 'data'})
self.assertEqual(post.status_code, 200)
post2 = requests.post(bin.url, files={'some': open('test_requests.py')}, data={'some': 'data'})
# self.assertEqual(post2.status_code, 200)
self.assertEqual(post2.status_code, 201)
def test_nonzero_evaluation(self):
r = requests.get('http://google.com/some-404-url')