def test_repr_author3(): assert u.repr_author(u.parse_name("van der Waals, Johannes D.")) \ == 'van der Waals, Johannes D.' assert u.repr_author(u.parse_name(" van der Waals , Johannes D. ")) \ == 'van der Waals, Johannes D.' assert u.repr_author( u.parse_name(" van der {Waals} , {Johannes D.}")) \ == 'van der {Waals}, {Johannes D.}'
def test_repr_author2(): # Strip outer blanks, collapse inner blanks (even protected): assert u.repr_author(u.parse_name("Johannes D. van der Waals")) \ == 'van der Waals, Johannes D.' assert u.repr_author(u.parse_name("Johannes D. van der Waals")) \ == 'van der Waals, Johannes D.' assert u.repr_author(u.parse_name(" Johannes D. van der Waals ")) \ == 'van der Waals, Johannes D.' assert u.repr_author(u.parse_name(" {Johannes D.} van der {Waals} ")) \ == 'van der {Waals}, {Johannes D.}' assert u.repr_author(u.parse_name("{Johannes D.} van der Waals")) \ == 'van der Waals, {Johannes D.}'
def test_repr_author1(): assert u.repr_author(u.parse_name("Jones")) == "Jones" assert u.repr_author(u.parse_name("Jones,")) == "Jones" assert u.repr_author(u.parse_name("Eric Jones")) == "Jones, Eric" assert u.repr_author(u.parse_name("Eric B. Jones")) == 'Jones, Eric B.'