Exemplo n.º 1
0
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.}'
Exemplo n.º 2
0
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.}'
Exemplo n.º 3
0
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.'