mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Added failing test for issue #380.
This commit is contained in:
+13
-2
@@ -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__':
|
||||
|
||||
Reference in New Issue
Block a user