proxy_from_url: fix PACFetcher construction
This commit is contained in:
parent
ea2eefccb1
commit
19966a9b9f
@ -614,7 +614,7 @@ def proxy_from_url(url):
|
|||||||
|
|
||||||
scheme = url.scheme()
|
scheme = url.scheme()
|
||||||
if scheme in ['pac+http', 'pac+https']:
|
if scheme in ['pac+http', 'pac+https']:
|
||||||
return pac.PACFetcher
|
return pac.PACFetcher(url)
|
||||||
|
|
||||||
types = {
|
types = {
|
||||||
'http': QNetworkProxy.HttpProxy,
|
'http': QNetworkProxy.HttpProxy,
|
||||||
|
@ -765,7 +765,7 @@ class TestProxyFromUrl:
|
|||||||
@pytest.mark.parametrize('scheme', ['pac+http', 'pac+https'])
|
@pytest.mark.parametrize('scheme', ['pac+http', 'pac+https'])
|
||||||
def test_proxy_from_url_pac(self, scheme):
|
def test_proxy_from_url_pac(self, scheme):
|
||||||
fetcher = urlutils.proxy_from_url(QUrl('{}://foo'.format(scheme)))
|
fetcher = urlutils.proxy_from_url(QUrl('{}://foo'.format(scheme)))
|
||||||
assert fetcher is pac.PACFetcher
|
assert isinstance(fetcher, pac.PACFetcher)
|
||||||
|
|
||||||
@pytest.mark.parametrize('url, exception', [
|
@pytest.mark.parametrize('url, exception', [
|
||||||
('blah', urlutils.InvalidProxyTypeError),
|
('blah', urlutils.InvalidProxyTypeError),
|
||||||
|
Loading…
Reference in New Issue
Block a user