示例#1
0
文件: page.py 项目: Etiqa/eats
 def get_favicon_url(self):
     href = self.get_favicon_info()
     if href is None:
         return utils.get_root_url(self.current_url()) + "favicon.ico"
     url_obj = urlparse(href)
     if href.startwith('//'):
         url_obj = urlparse(self.current_url())
         return url_obj.scheme + href
     elif url_obj.scheme == '':
         return utils.get_root_url(self.current_url()) + href
示例#2
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_local_url_with_port(self):
     self.assertEqual(get_root_url('http://localhost:9998/'),
                      'http://localhost:9998/')
示例#3
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_remote_url_with_query_and_port(self):
     self.assertEqual(
         get_root_url('http://www.hoverstate.com:8080/?favicon.ico'),
         'http://www.hoverstate.com:8080/')
示例#4
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_local_url(self):
     self.assertEqual(get_root_url('http://localhost/'),
                      'http://localhost/')
示例#5
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_remote_url_with_fragment(self):
     self.assertEqual(get_root_url('http://www.hoverstate.com/#/form'),
                      'http://www.hoverstate.com/')
示例#6
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_remote_url_with_path(self):
     self.assertEqual(get_root_url('http://www.hoverstate.com/favicon.ico'),
                      'http://www.hoverstate.com/')
示例#7
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_remote_url_with_port(self):
     self.assertEqual(get_root_url('http://www.hoverstate.com:8080/'),
                      'http://www.hoverstate.com:8080/')
示例#8
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_remote_url(self):
     self.assertEqual(get_root_url('http://www.hoverstate.com/'),
                      'http://www.hoverstate.com/')
示例#9
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_local_url_with_query_and_port(self):
     self.assertEqual(get_root_url('http://localhost:9998/?favicon.ico'),
                      'http://localhost:9998/')
示例#10
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_local_url_with_query(self):
     self.assertEqual(get_root_url('http://localhost/?favicon.ico'),
                      'http://localhost/')
示例#11
0
文件: test_utils.py 项目: Etiqa/eats
 def test_get_root_url_local_url_with_fragment(self):
     self.assertEqual(get_root_url('http://localhost/#/form'),
                      'http://localhost/')