示例#1
0
 def test_long_hash(self):
     result = paper_links.main(bitly=True, long_hash=True)[0]
     m = re.search('bit.ly/(.{12})$', result)
     self.assertEqual(len(m.group(1)), 12)
示例#2
0
 def test_bitly(self):
     result = paper_links.main(bitly=True)
     self.assertEqual(result[0][:15], "https://bit.ly/")
示例#3
0
 def test_soogd_length(self):
     result = paper_links.main(soogd=True)
     self.assertEqual(len(result[0]), 19)
示例#4
0
 def test_all_urls_length(self):
     result = paper_links.main(all_urls=True)
     self.assertEqual(len(result), 5)
示例#5
0
 def test_isgd_length(self):
     result = paper_links.main(isgd=True)
     self.assertEqual(len(result[0]), 20)
示例#6
0
 def test_soogd(self):
     result = paper_links.main(soogd=True)
     self.assertEqual(result[0][:15], "https://soo.gd/")
示例#7
0
 def test_isgd(self):
     result = paper_links.main(isgd=True)
     self.assertEqual(result[0][:14], "https://is.gd/")
示例#8
0
 def test_tinyurl_length(self):
     result = paper_links.main(tinyurl=True)
     self.assertEqual(len(result[0]), 28)
示例#9
0
 def test_tinyurl(self):
     result = paper_links.main(tinyurl=True)
     self.assertEqual(result[0][:20], "https://tinyurl.com/")
示例#10
0
 def test_tinycc(self):
     result = paper_links.main(tinycc=True)
     self.assertEqual(result[0][:16], "https://tiny.cc/")
示例#11
0
 def test_bitly_length(self):
     result = paper_links.main(bitly=True)
     self.assertEqual(len(result[0]), 22)