Skip to content
Myr

Add more tests to `test_invalid_url`

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

This adds tests for the behavior introduced in b149be5d, where `PreparedRequest` was made to skip `parse_url` for e.g. `localhost:3128/`.

authored by Daniel Hahler · committed by Daniel Hahler · parent 9e8702d · Browse files · 1 file+9 added−2 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+9 added−2 removed

  • other:+9 added−2 removed

1 file+9 added−2 removed

modified:test_requests.py+9 added-2 removed
16 unmodified lines
17from requests.auth import HTTPDigestAuth, _basic_auth_str18from requests.compat import (19 Morsel, cookielib, getproxies, str, urljoin, urlparse, is_py3, builtin_str)20from requests.cookies import cookiejar_from_dict, morsel_to_cookie21from requests.exceptions import (InvalidURL, MissingSchema, ConnectTimeout,22 ReadTimeout, ConnectionError, Timeout)21from requests.exceptions import (ConnectionError, ConnectTimeout,22 InvalidSchema, InvalidURL, MissingSchema,23 ReadTimeout, Timeout)24from requests.models import PreparedRequest25from requests.structures import CaseInsensitiveDict26from requests.sessions import SessionRedirectMixin27from requests.models import urlencode
50 unmodified lines
7879 def test_invalid_url(self):80 with pytest.raises(MissingSchema):81 requests.get('hiwpefhipowhefopw')82 with pytest.raises(InvalidSchema):83 requests.get('localhost:3128')84 with pytest.raises(InvalidSchema):85 requests.get('localhost.localdomain:3128/')86 with pytest.raises(InvalidSchema):87 requests.get('10.122.1.1:3128/')88 with pytest.raises(InvalidURL):89 requests.get('http://')9091 def test_basic_building(self):
1405 unmodified lines