Skip to content
Myr

Test for throwing useful exception on bad label.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cory Benfield · committed by Cory Benfield · parent 27b55a7 · Browse files · 1 file+5 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−0 removed

  • tests:+5 added−0 removed

1 file+5 added−0 removed

modified:tests/test_requests.py+5 added
17 unmodified lines
18# import envoy19from requests import HTTPError20from requests import get, post, head, put21from requests.auth import HTTPBasicAuth, HTTPDigestAuth22from requests.exceptions import InvalidURL2324if 'HTTPBIN_URL' not in os.environ:25 os.environ['HTTPBIN_URL'] = 'http://httpbin.org/'26
1035 unmodified lines
1062 def test_bytes_files(self):1063 """Test that `bytes` can be used as the values of `files`."""1064 post(httpbin('post'), files={'test': b'test'})10651066 def test_invalid_urls_throw_requests_exception(self):1067 """Test that URLs with invalid labels throw1068 Requests.exceptions.InvalidURL instead of UnicodeError."""1069 self.assertRaises(InvalidURL, get, 'http://.google.com/')10701071if __name__ == '__main__':1072 unittest.main()