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