Esempio n. 1
0
 def _check_retrieve(self, url, filename, headers):
     self.assertEqual(headers.get('Content-Type'), 'text/html')
     if self.no_proxies:
         proxies = {}
     else:
         proxies = None
     self.assertEqual(read_file(filename),
                      urlopen(url, proxies=proxies).read())
Esempio n. 2
0
 def _check_retrieve(self, url, filename, headers):
     from urllib import urlopen
     self.assertEqual(headers.get('Content-Type'), 'text/html')
     if self.no_proxies:
         proxies = {}
     else:
         proxies = None
     self.assertEqual(read_file(filename),
                      urlopen(url, proxies=proxies).read())
Esempio n. 3
0
    def add_tests(cls):
        if not os.path.exists(cls.OPERA_COOKIE_TEST_URIS_PATH):
            return

        for uri in read_file(cls.OPERA_COOKIE_TEST_URIS_PATH).splitlines():
            cls.add_test(uri)
Esempio n. 4
0
    def add_tests(cls):
        if not os.path.exists(cls.OPERA_COOKIE_TEST_URIS_PATH):
            return

        for uri in read_file(cls.OPERA_COOKIE_TEST_URIS_PATH).splitlines():
            cls.add_test(uri)