Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_split_authors(self):
self.assertListEqual(split_authors('Simeon Warner'),
['Simeon Warner'])
self.assertListEqual(split_authors('The DELPHI Collaboration, J. Abdallah, et al'),
['The DELPHI Collaboration', ',', 'J. Abdallah', ',', 'et al'])
self.assertListEqual(split_authors('BELLE Collaboration: A Person, Nother Person'),
['BELLE Collaboration', ':', 'A Person', ',', 'Nother Person'])
self.assertListEqual(split_authors('Simeon Warner, Herbert Van de Sompel'),
['Simeon Warner', ',', 'Herbert Van de Sompel'])
self.assertListEqual(
split_authors('An Author'),
['An Author'],
'single author'
)
self.assertListEqual(
split_authors(''),
['The DELPHI Collaboration', ',', 'J. Abdallah', ',', 'et al'])
self.assertListEqual(split_authors('BELLE Collaboration: A Person, Nother Person'),
['BELLE Collaboration', ':', 'A Person', ',', 'Nother Person'])
self.assertListEqual(split_authors('Simeon Warner, Herbert Van de Sompel'),
['Simeon Warner', ',', 'Herbert Van de Sompel'])
self.assertListEqual(
split_authors('An Author'),
['An Author'],
'single author'
)
self.assertListEqual(
split_authors(''),
[],
'empty author'
)
self.assertListEqual(
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
split_authors('An Author and Another P. H. J. Author (affil)'),
'single author with affil'
)
self.assertListEqual(
split_authors('An Author and Another P. H. J. Author (affil)'),
['An Author', ',', 'Another P. H. J. Author', '(affil)'],
'double author with affil'
)
self.assertListEqual(
split_authors(
'John Von Neumann, Herbert Van de Sompel, Fred Bloggs, Jr, et al'),
['John Von Neumann', ',', 'Herbert Van de Sompel',
',', 'Fred Bloggs, Jr', ',', 'et al'],
'multiple with prefixes and suffixes'
)
self.assertListEqual(
split_authors('sum won ( whatever affil data unmunged )'),
['sum won', '( whatever affil data unmunged )'],
'one author, two labs'
)
self.assertListEqual(
split_authors('sum won(1,2)((1)lab a,(2)lab b)'),
['sum won', '(1,2)', '((1)lab a,(2)lab b)'],
'one author, two labs'
)
['Simeon Warner', ',', 'Herbert Van de Sompel'])
self.assertListEqual(
split_authors('An Author'),
['An Author'],
'single author'
)
self.assertListEqual(
split_authors(''),
[],
'empty author'
)
self.assertListEqual(
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
split_authors('An Author and Another P. H. J. Author (affil)'),
['An Author', ',', 'Another P. H. J. Author', '(affil)'],
'double author with affil'
)
self.assertListEqual(
split_authors(
'John Von Neumann, Herbert Van de Sompel, Fred Bloggs, Jr, et al'),
def test_split_authors(self):
self.assertListEqual(split_authors('Simeon Warner'),
['Simeon Warner'])
self.assertListEqual(split_authors('The DELPHI Collaboration, J. Abdallah, et al'),
['The DELPHI Collaboration', ',', 'J. Abdallah', ',', 'et al'])
self.assertListEqual(split_authors('BELLE Collaboration: A Person, Nother Person'),
['BELLE Collaboration', ':', 'A Person', ',', 'Nother Person'])
self.assertListEqual(split_authors('Simeon Warner, Herbert Van de Sompel'),
['Simeon Warner', ',', 'Herbert Van de Sompel'])
self.assertListEqual(
split_authors('An Author'),
['An Author'],
'single author'
)
self.assertListEqual(
split_authors(''),
[],
'empty author'
)
self.assertListEqual(
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
def test_split_authors(self):
self.assertListEqual(split_authors('Simeon Warner'),
['Simeon Warner'])
self.assertListEqual(split_authors('The DELPHI Collaboration, J. Abdallah, et al'),
['The DELPHI Collaboration', ',', 'J. Abdallah', ',', 'et al'])
self.assertListEqual(split_authors('BELLE Collaboration: A Person, Nother Person'),
['BELLE Collaboration', ':', 'A Person', ',', 'Nother Person'])
self.assertListEqual(split_authors('Simeon Warner, Herbert Van de Sompel'),
['Simeon Warner', ',', 'Herbert Van de Sompel'])
self.assertListEqual(
split_authors('An Author'),
['An Author'],
'single author'
)
self.assertListEqual(
split_authors(''),
[],
'empty author'
)
self.assertListEqual(
split_authors('An Author (affil)'),
'double author with affil'
)
self.assertListEqual(
split_authors(
'John Von Neumann, Herbert Van de Sompel, Fred Bloggs, Jr, et al'),
['John Von Neumann', ',', 'Herbert Van de Sompel',
',', 'Fred Bloggs, Jr', ',', 'et al'],
'multiple with prefixes and suffixes'
)
self.assertListEqual(
split_authors('sum won ( whatever affil data unmunged )'),
['sum won', '( whatever affil data unmunged )'],
'one author, two labs'
)
self.assertListEqual(
split_authors('sum won(1,2)((1)lab a,(2)lab b)'),
['sum won', '(1,2)', '((1)lab a,(2)lab b)'],
'one author, two labs'
)
'single author'
)
self.assertListEqual(
split_authors(''),
[],
'empty author'
)
self.assertListEqual(
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
split_authors('An Author and Another P. H. J. Author (affil)'),
['An Author', ',', 'Another P. H. J. Author', '(affil)'],
'double author with affil'
)
self.assertListEqual(
split_authors(
'John Von Neumann, Herbert Van de Sompel, Fred Bloggs, Jr, et al'),
['John Von Neumann', ',', 'Herbert Van de Sompel',
',', 'Fred Bloggs, Jr', ',', 'et al'],
'multiple with prefixes and suffixes'
)
self.assertListEqual(
def test_split_authors(self):
self.assertListEqual(split_authors('Simeon Warner'),
['Simeon Warner'])
self.assertListEqual(split_authors('The DELPHI Collaboration, J. Abdallah, et al'),
['The DELPHI Collaboration', ',', 'J. Abdallah', ',', 'et al'])
self.assertListEqual(split_authors('BELLE Collaboration: A Person, Nother Person'),
['BELLE Collaboration', ':', 'A Person', ',', 'Nother Person'])
self.assertListEqual(split_authors('Simeon Warner, Herbert Van de Sompel'),
['Simeon Warner', ',', 'Herbert Van de Sompel'])
self.assertListEqual(
split_authors('An Author'),
['An Author'],
'single author'
)
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
split_authors('An Author (affil)'),
['An Author', '(affil)'],
'single author with affil'
)
self.assertListEqual(
split_authors('An Author and Another P. H. J. Author (affil)'),
['An Author', ',', 'Another P. H. J. Author', '(affil)'],
'double author with affil'
)
self.assertListEqual(
split_authors(
'John Von Neumann, Herbert Van de Sompel, Fred Bloggs, Jr, et al'),
['John Von Neumann', ',', 'Herbert Van de Sompel',
',', 'Fred Bloggs, Jr', ',', 'et al'],
'multiple with prefixes and suffixes'
)
self.assertListEqual(
split_authors('sum won ( whatever affil data unmunged )'),
['sum won', '( whatever affil data unmunged )'],
'one author, two labs'
)
self.assertListEqual(
split_authors('sum won(1,2)((1)lab a,(2)lab b)'),
['sum won', '(1,2)', '((1)lab a,(2)lab b)'],
'one author, two labs'
)