def test_and_in_name(): names = 'Cooler, Brandywine W.' n = reorder(names, None) assert n == 'B.W. Cooler'
def test_unicode_good(): names = 'Namé, Unicode C.' n = reorder(names, 'U.C. Namé') assert n == '**U.C. Namé**'
def test_missing_name(): names = 'Author, First A.' with pytest.warns(UserWarning): reorder(names, 'Missing Author')
def test_three_authors_good(): names = 'Author, First A. and Name, Second N. and Name, Unicode C.' n = reorder(names, 'F.A. Author') assert n == '**F.A. Author**, S.N. Name, and U.C. Name'
def test_empty_name(): names = 'Name, First A. and and Name, Second A.' n = reorder(names, None) assert n == 'F.A. Name and S.A. Name'
def test_from_name(): names = 'van Name, First A.' n = reorder(names, None) assert n == 'F.A. van Name'
def test_junior_name(): names = 'Name, Jr, First A. and Name, Second A.' n = reorder(names, None) assert n == 'F.A. Name, Jr and S.A. Name'
def test_no_highlighted_name(): names = 'Author, First A.' n = reorder(names, None) assert n == 'F.A. Author'
def test_hyphenated_name(): names = 'Name, Hypen-Ated' n = reorder(names, None) assert n == 'H.A. Name'
def test_single_author_good(): names = 'Author, First A.' n = reorder(names, 'F.A. Author') assert n == '**F.A. Author**'
def test_two_authors_good(): names = 'Author, First A. and Name, Second N.' n = reorder(names, 'F.A. Author') assert n == '**F.A. Author** and S.N. Name'