Esempio n. 1
0
 def test_split_names_on_ampersand(self):
     names = "Joe Blogs & Jane Smith & John Doe"
     out = authorparser.split_names(names)
     self.assertEqual(len(out), 3)
     self.assertEqual(out[0], 'Joe Blogs')
     self.assertEqual(out[1], 'Jane Smith')
     self.assertEqual(out[2], 'John Doe')
Esempio n. 2
0
 def test_split_names_on_hyphen(self):
     names = "Joe Blogs - Jane Smith -- John Doe- Jim Jones"
     out = authorparser.split_names(names)
     self.assertEqual(len(out), 4)
     self.assertEqual(out[0], 'Joe Blogs')
     self.assertEqual(out[1], 'Jane Smith')
     self.assertEqual(out[2], 'John Doe')
     self.assertEqual(out[3], 'Jim Jones')
Esempio n. 3
0
 def test_split_names_mixed(self):
     names = "Joe Blogs, Jane Smith; John Doe and Jim Jones"
     out = authorparser.split_names(names)
     self.assertEqual(len(out), 4)
     self.assertEqual(out[0], 'Joe Blogs')
     self.assertEqual(out[1], 'Jane Smith')
     self.assertEqual(out[2], 'John Doe')
     self.assertEqual(out[3], 'Jim Jones')
Esempio n. 4
0
 def test_split_names_on_semicolon(self):
     names = "Joe Blogs; Jane Smith"
     out = authorparser.split_names(names)
     self.assertEqual(len(out), 2)
     self.assertEqual(out[0], 'Joe Blogs')
     self.assertEqual(out[1], 'Jane Smith')
Esempio n. 5
0
 def split_names_multiple_email_in_brackets(self):
     names = "Joe Blogs ([email protected]), Jane Doe ([email protected])"
     out = authorparser.split_names(names)
     self.assertEqual(len(out), 2)
     self.assertEqual(out[0], "Joe Blogs ([email protected])")
     self.assertEqual(out[1], "Jane Doe ([email protected])")
Esempio n. 6
0
 def test_split_names_email_in_brackets(self):
     names = "Joe Blogs ([email protected])"
     out = authorparser.split_names(names)
     self.assertEqual(out[0], names)
Esempio n. 7
0
 def test_split_names_multiple_emails(self):
     names = "[email protected], [email protected]"
     out = authorparser.split_names(names)
     self.assertEqual(len(out), 2)
     self.assertEqual(out[0], "*****@*****.**")
     self.assertEqual(out[1], "*****@*****.**")
Esempio n. 8
0
 def test_split_names_email(self):
     names = "*****@*****.**"
     out = authorparser.split_names(names)
     self.assertEqual(out[0], names)
Esempio n. 9
0
 def test_split_names_multiple_rss_names(self):
     names = "[email protected] (Lawyer Boyer), [email protected] (Joe Bloggs)"
     out = authorparser.split_names(names)
     self.assertEqual(len(out), 2)
     self.assertEqual(out[0], "[email protected] (Lawyer Boyer)")
     self.assertEqual(out[1], "[email protected] (Joe Bloggs)")
Esempio n. 10
0
 def test_split_names_rss_name(self):
     names = "[email protected] (Lawyer Boyer)"
     out = authorparser.split_names(names)
     self.assertEqual(out[0], names)
Esempio n. 11
0
 def test_split_names_single_name(self):
     names = "Joe Blogs"
     out = authorparser.split_names(names)
     self.assertEqual(len(out), 1)
     self.assertEqual(out[0], 'Joe Blogs')