예제 #1
0
 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")
예제 #2
0
 def test_parse_not_url(self):
     protocol, site, path = parse_url("ana%243f")
     self.assertEqual(protocol, "")
     self.assertEqual(site, "")
     self.assertEqual(path, "")
예제 #3
0
 def test_parse_not_url_2(self):
     protocol, site, path = parse_url("ssefd/index.html")
     self.assertEqual(protocol, "")
     self.assertEqual(site, "")
     self.assertEqual(path, "")
예제 #4
0
 def test_parse_url_not_path(self):
     protocol, site, path = parse_url("http://www.twitter.com")
     self.assertEqual(protocol, "http")
     self.assertEqual(site, "www.twitter.com")
     self.assertEqual(path, "")
예제 #5
0
 def test_parse_url_not_site(self):
     protocol, site, path = parse_url("http://")
     self.assertEqual(protocol, "http")
     self.assertEqual(site, "")
     self.assertEqual(path, "")
예제 #6
0
 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, "index.html")
예제 #7
0
 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")
예제 #8
0
 def test_parse_not_url_2(self):
     protocol, site, path = parse_url("ssefd/index.html")
     self.assertEqual(protocol, "")
     self.assertEqual(site, "")
     self.assertEqual(path, "")
예제 #9
0
 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")
예제 #10
0
 def test_parse_not_url(self):
     protocol, site, path = parse_url("ana%243f")
     self.assertEqual(protocol, "")
     self.assertEqual(site, "")
     self.assertEqual(path, "")
예제 #11
0
 def test_parse_url_not_site(self):
     protocol, site, path = parse_url("http://")
     self.assertEqual(protocol, "http")
     self.assertEqual(site, "")
     self.assertEqual(path, "")
예제 #12
0
 def test_parse_url_not_path(self):
     protocol, site, path = parse_url("http://www.twitter.com")
     self.assertEqual(protocol, "http")
     self.assertEqual(site, "www.twitter.com")
     self.assertEqual(path, "")
예제 #13
0
 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")
예제 #14
0
 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, "index.html")