proxy_from_url: fix PACFetcher construction

This commit is contained in:
Nikolay Amiantov 2017-01-02 18:49:14 +03:00
parent ea2eefccb1
commit 19966a9b9f
2 changed files with 2 additions and 2 deletions

View File

@ -614,7 +614,7 @@ def proxy_from_url(url):
scheme = url.scheme()
if scheme in ['pac+http', 'pac+https']:
return pac.PACFetcher
return pac.PACFetcher(url)
types = {
'http': QNetworkProxy.HttpProxy,

View File

@ -765,7 +765,7 @@ class TestProxyFromUrl:
@pytest.mark.parametrize('scheme', ['pac+http', 'pac+https'])
def test_proxy_from_url_pac(self, 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', [
('blah', urlutils.InvalidProxyTypeError),