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))
def test_check_url__without_network__empty_URL(self): about_file = AboutFile() self.assertFalse(about_file.check_url('http:', False))
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))
def test_check_url__without_network__not_ends_with_com(self): about_file = AboutFile() self.assertTrue(about_file.check_url('http://www.google', False))
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))
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))
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))
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))
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))