def test_collect_pac_urls(self): with patch('pypac.api.ON_WINDOWS', return_value=True), \ patch('socket.getfqdn', return_value='host.dns.local'): with patch('pypac.api.autoconfig_url_from_registry', return_value='http://foo.bar/proxy.pac'): assert collect_pac_urls() == [ 'http://foo.bar/proxy.pac', 'http://wpad.dns.local/wpad.dat', 'http://wpad.local/wpad.dat', ] with patch('pypac.api.autoconfig_url_from_registry', return_value=r'C:\foo'): assert collect_pac_urls() == [ 'http://wpad.dns.local/wpad.dat', 'http://wpad.local/wpad.dat', ]
def test_collect_pac_urls(self): with patch("pypac.api.ON_WINDOWS", return_value=True), patch("socket.getfqdn", return_value="host.dns.local"): with patch("pypac.api.autoconfig_url_from_registry", return_value="http://foo.bar/proxy.pac"): assert collect_pac_urls() == [ "http://foo.bar/proxy.pac", "http://wpad.dns.local/wpad.dat", "http://wpad.local/wpad.dat", ] with patch("pypac.api.autoconfig_url_from_registry", return_value=r"C:\foo"): assert collect_pac_urls() == [ "http://wpad.dns.local/wpad.dat", "http://wpad.local/wpad.dat", ]