コード例 #1
0
 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',
             ]
コード例 #2
0
ファイル: test_api.py プロジェクト: rbcarson/pypac
 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',
             ]
コード例 #3
0
ファイル: test_api.py プロジェクト: zanachka/pypac
 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",
             ]