postbin tests were broken
authorKenneth Reitz <me@kennethreitz.com>
Fri, 25 Feb 2011 13:00:23 +0000 (08:00 -0500)
committerKenneth Reitz <me@kennethreitz.com>
Fri, 25 Feb 2011 13:00:23 +0000 (08:00 -0500)
test_requests.py

index 51d103d..9249faf 100644 (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')