Added failing test for issue #380.

This commit is contained in:
Cory Benfield
2012-02-16 18:21:32 +00:00
parent 8e2696b385
commit d339b0f64f
+13 -2
View File
@@ -23,8 +23,7 @@ from requests.auth import HTTPBasicAuth, HTTPDigestAuth
if (sys.platform == 'win32') and ('HTTPBIN_URL' not in os.environ):
os.environ['HTTPBIN_URL'] = 'http://httpbin.org/'
os.environ['HTTPBIN_URL'] = 'http://httpbin.org/'
# TODO: Detect an open port.
PORT = os.environ.get('HTTPBIN_PORT', '7077')
@@ -813,6 +812,18 @@ class RequestsTestSuite(TestSetup, unittest.TestCase):
r = requests.get(httpbin('post'), auth=('a', 'b'), data='\xff')
def test_useful_exception_for_invalid_schema(self):
try:
self.assertRaises(
requests.exceptions.URLRequired,
get,
'http://http://')
# To make this test as minimal as possible, only catch the
# exception raised in issue #380.
except ValueError:
self.fail()
if __name__ == '__main__':