def test_split_fullname(): """Test author fullname splitting.""" author1 = 'Doe, John Magic' author2 = 'Doe Boe, John Magic' author3 = 'Doe Boe John Magic' author4 = 'John Magic Doe' author5 = 'John Magic Doe Boe' author6 = 'John Magic, Doe Boe' author7 = '' assert split_fullname(author1) == ('Doe', 'John Magic') assert split_fullname(author2) == ('Doe Boe', 'John Magic') assert split_fullname(author3, switch_name_order=True) == ('Doe', 'Boe John Magic') assert split_fullname(author4) == ('Doe', 'John Magic') assert split_fullname(author5) == ('Boe', 'John Magic Doe') assert split_fullname(author6, switch_name_order=True) == ('Doe Boe', 'John Magic') assert split_fullname(author7) == ('', '')
def test_split_fullname(): """Test author fullname splitting.""" author1 = 'Doe, John Magic' author2 = 'Doe Boe, John Magic' author3 = 'Doe Boe John Magic' author4 = 'John Magic Doe' author5 = 'John Magic Doe Boe' author6 = 'John Magic, Doe Boe' author7 = '' assert split_fullname(author1) == ('Doe', 'John Magic') assert split_fullname(author2) == ('Doe Boe', 'John Magic') assert split_fullname(author3, switch_name_order=True) == ('Doe', 'Boe John Magic') assert split_fullname(author4 ) == ('Doe', 'John Magic') assert split_fullname(author5 ) == ('Boe', 'John Magic Doe') assert split_fullname(author6, switch_name_order=True) == ('Doe Boe', 'John Magic') assert split_fullname(author7) == ('', '')