|
4 | 4 | from axelrod.action import Action
|
5 | 5 | from ctypes import c_int, c_float, POINTER
|
6 | 6 |
|
| 7 | +import itertools |
| 8 | + |
7 | 9 | from hypothesis import given
|
8 | 10 | from hypothesis.strategies import integers
|
9 | 11 |
|
@@ -31,17 +33,15 @@ def test_matches():
|
31 | 33 |
|
32 | 34 |
|
33 | 35 | @given(
|
34 |
| - their_last_move=integers(min_value=0, max_value=1), |
35 | 36 | move_number=integers(min_value=1, max_value=200),
|
36 | 37 | my_score=integers(min_value=0, max_value=200),
|
37 | 38 | their_score=integers(min_value=0, max_value=200),
|
38 |
| - my_last_move=integers(min_value=0, max_value=1)) |
39 |
| -def test_original_strategy( |
40 |
| - their_last_move, move_number, my_score, their_score, my_last_move |
41 |
| -): |
42 |
| - for strategy in all_strategies: |
43 |
| - player = Player(strategy) |
44 |
| - action = player.original_strategy( |
45 |
| - their_last_move, move_number, my_score, their_score, 0, |
46 |
| - my_last_move) |
47 |
| - assert action in (0, 1), print(f'{strategy} returned {action}') |
| 39 | + ) |
| 40 | +def test_original_strategy(move_number, my_score, their_score): |
| 41 | + for their_last_move, my_last_move in itertools.product((0, 1), repeat=2): |
| 42 | + for strategy in all_strategies: |
| 43 | + player = Player(strategy) |
| 44 | + action = player.original_strategy( |
| 45 | + their_last_move, move_number, my_score, their_score, 0, |
| 46 | + my_last_move) |
| 47 | + assert action in (0, 1), print(f'{strategy} returned {action}') |
0 commit comments