Beispiel #1
0
 def test_check_url__without_network__ends_with_slash(self):
     about_file = AboutFile()
     self.assertTrue(about_file.check_url('http://www.google.co.uk/', False))
Beispiel #2
0
 def test_check_url__without_network__empty_URL(self):
     about_file = AboutFile()
     self.assertFalse(about_file.check_url('http:', False))
Beispiel #3
0
 def test_check_url__without_network__no_schemes(self):
     about_file = AboutFile()
     self.assertFalse(about_file.check_url('google.com', False))
     self.assertFalse(about_file.check_url('www.google.com', False))
     self.assertFalse(about_file.check_url('', False))
Beispiel #4
0
 def test_check_url__without_network__not_ends_with_com(self):
     about_file = AboutFile()
     self.assertTrue(about_file.check_url('http://www.google', False))
Beispiel #5
0
 def test_check_url__without_network__not_starting_with_www(self):
     about_file = AboutFile()
     self.assertTrue(about_file.check_url('https://nexb.com', False))
     self.assertTrue(about_file.check_url('http://archive.apache.org/dist/httpcomponents/commons-httpclient/2.0/source/commons-httpclient-2.0-alpha2-src.tar.gz', False))
     self.assertTrue(about_file.check_url('http://de.wikipedia.org/wiki/Elf (Begriffsklärung)', False))
     self.assertTrue(about_file.check_url('http://nothing_here.com', False))
Beispiel #6
0
 def test_check_url__with_network__not_reachable(self):
     about_file = AboutFile()
     if check_network_connection():
         self.assertFalse(about_file.check_url('http://www.google', True))
Beispiel #7
0
 def test_check_url__with_network__not_starting_with_www_and_spaces(self):
     # TODO: this does work yet as we do not have a solution for now (URL with spaces)
     about_file = AboutFile()
     self.assertTrue(about_file.check_url(u'http://de.wikipedia.org/wiki/Elf (Begriffsklärung)', True))
Beispiel #8
0
 def test_check_url__with_network__not_starting_with_www(self):
     about_file = AboutFile()
     self.assertTrue(about_file.check_url('https://nexb.com', True))
     self.assertTrue(about_file.check_url('http://archive.apache.org/dist/httpcomponents/commons-httpclient/2.0/source/commons-httpclient-2.0-alpha2-src.tar.gz', True))
     if check_network_connection():
         self.assertFalse(about_file.check_url('http://nothing_here.com', True))
Beispiel #9
0
 def test_check_url__with_network(self):
     about_file = AboutFile()
     self.assertTrue(about_file.check_url('http://www.google.com', True))
     self.assertTrue(about_file.check_url('http://www.google.co.uk/', True))