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')