Example #1
0
def test_chain_strike_2():
    j1 = Joueur("TOTO")
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((2, 0))
    assert j1.calculer_score() == 66
Example #2
0
def test_chain_strike():
    j1 = Joueur("Patrick")
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((5, 2))
    assert j1.calculer_score() == 139
Example #3
0
def test_limite_dix():
    j1 = Joueur("Eric", [(10, 0)])
    assert j1.calculer_score() == 10
Example #4
0
def test_spare_coup():
    j1 = Joueur("Eric")
    j1.changer_tableau_score([(10, 0), (10, 0), (10, 0), (10, 0), (10, 0),
                              (10, 0), (10, 0), (10, 0), (10, 0), (10, 0),
                              (5, 5)])
    assert j1.calculer_score() == 285
Example #5
0
def test_full_strike():
    j1 = Joueur("Patrick")
    j1.changer_tableau_score([(10, 0), (10, 0), (10, 0), (10, 0), (10, 0),
                              (10, 0), (10, 0), (10, 0), (10, 0), (10, 0),
                              (10, 0), (10, 0)])
    assert j1.calculer_score() == 300
Example #6
0
def test_tuple():
    j1 = Joueur("Patrick")
    j1.ajouter_score_manche((1, 2))
    j1.ajouter_score_manche((3, 4))
    assert j1.calculer_score() == 10
Example #7
0
def test_strike():
    j1 = Joueur()
    j1.ajouter_score_manche((10, 0))
    j1.ajouter_score_manche((5, 2))
    assert j1.calculer_score() == 24
Example #8
0
def test_spare():
    j1 = Joueur("Patrick")
    j1.ajouter_score_manche((5, 5))
    j1.ajouter_score_manche((5, 2))
    assert j1.calculer_score() == 22
Example #9
0
def test_limite_zero():
    j1 = Joueur("Patrick")
    j1.ajouter_score_manche((1, 0))
    assert j1.calculer_score() == 1