def test_parse_url_not_protocol(self): protocol, site, path = parse_url("www.twitter.com/anarb/index.html") self.assertEqual(protocol, "") self.assertEqual(site, "www.twitter.com") self.assertEqual(path, "anarb/index.html")
def test_parse_url_notequal(self): protocol, site, path = parse_url("https://www.flickr.com/photo/anarey/") self.assertNotEqual(protocol, "http") self.assertNotEqual(site, "www.anarey.info") self.assertNotEqual(path, "photo/anarey")
def test_return_value(self): protocol, site, path = parse_url("http://www.anarey.info/index.html") self.assertEqual(protocol, "http") self.assertEqual(site, "www.anarey.info") self.assertEqual(path, "index.html")
def test_parse_not_url_2(self): protocol, site, path = parse_url("ssefd/index.html") self.assertEqual(protocol, "") self.assertEqual(site, "") self.assertEqual(path, "")
def test_parse_not_url(self): protocol, site, path = parse_url("ana%243f") self.assertEqual(protocol, "") self.assertEqual(site, "") self.assertEqual(path, "")
def test_parse_url_not_site(self): protocol, site, path = parse_url("http://") self.assertEqual(protocol, "http") self.assertEqual(site, "") self.assertEqual(path, "")