示例#1
0
def test_add_guardians():
    p = Player('Tatiana', 'Jones')

    # Add one guardian
    g1 = Guardian('Mary', 'Jones')
    p.add_guardian(g1)

    # Later, add some more
    g2 = Guardian('Joanie', 'Johnson')
    g3 = Guardian('Jerry', 'Johnson')
    p.add_guardians([g2, g3])

    assert [g1, g2, g3] == p.guardians
示例#2
0
def test_primary_guardian():
    p = Player('Tatiana', 'Jones')

    # Add one guardian
    g1 = Guardian('Mary', 'Jones')
    p.add_guardian(g1)

    # Later, add some more
    g2 = Guardian('Joanie', 'Johnson')
    g3 = Guardian('Jerry', 'Johnson')
    p.add_guardians((g2, g3))

    assert g1 == p.primary_guardian
示例#3
0
def test_construction():
    p = Player('Tatiana', 'Jones')
    assert 'Tatiana' == p.first_name
    assert 'Jones' == p.last_name
    assert [] == p.guardians
示例#4
0
def test_add_guardian():
    g = Guardian('Mary', 'Jones')
    p = Player('Tatiana', 'Jones')
    p.add_guardian(g)
    assert [g] == p.guardians
示例#5
0
def player_one() -> Player:
    return Player('Tatiana', 'Jones')