-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_yahtzee.py
82 lines (50 loc) · 2.14 KB
/
test_yahtzee.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from yahtzee import *
import pytest
@pytest.mark.parametrize("n", [1, 2, 3, 4, 5])
def test__roll__returns_correct_number_of_dice(n):
assert len(roll(n)) == n
def test__roll__returns_dice_with_correct_values():
for die in roll(5):
assert die in range(1, 7)
@pytest.mark.parametrize("dice, keep, valid", [])
def test__keep__is_valid(dice, keep, valid):
assert is_valid_to_keep(dice, keep) is valid
@pytest.mark.parametrize("dice, expected", [])
def test__score__ones(dice, expected):
assert score_ones(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__twos(dice, expected):
assert score_twos(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__threes(dice, expected):
assert score_threes(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__fours(dice, expected):
assert score_fours(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__fives(dice, expected):
assert score_fives(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__sixes(dice, expected):
assert score_sixes(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__3_of_a_kind(dice, expected):
assert score_3_of_a_kind(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__4_of_a_kind(dice, expected):
assert score_4_of_a_kind(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__small_straight(dice, expected):
assert score_small_straight(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__large_straight(dice, expected):
assert score_large_straight(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__full_house(dice, expected):
assert score_full_house(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__chance(dice, expected):
assert score_chance(dice) == expected
@pytest.mark.parametrize("dice, expected", [])
def test__score__yahtzee(dice, expected):
assert score_yahtzee(dice) == expected