Skip to content

Commit 2ce541c

Browse files
committed
added attrs to tests in ForgetfulGrudger
1 parent 63bcaa2 commit 2ce541c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

axelrod/tests/strategies/test_grudger.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,20 @@ def test_strategy(self):
5555
# D ten times and then continue to check for defections.
5656
opponent = axl.Cooperator()
5757
actions = [(C, C)] * 20
58-
self.versus_test(opponent, expected_actions=actions)
58+
attrs = {'grudged': False, 'mem_length': 10, 'grudge_memory': 0}
59+
self.versus_test(opponent, expected_actions=actions, attrs=attrs)
5960

61+
# grudge_memory goes to ten, resets and climbs back to five.
6062
opponent = axl.Defector()
61-
actions = [(C, D)] + [(D, D)] * 20
62-
self.versus_test(opponent, expected_actions=actions)
63+
actions = [(C, D)] + [(D, D)] * 15
64+
attrs = {'grudged': True, 'mem_length': 10, 'grudge_memory': 5}
65+
self.versus_test(opponent, expected_actions=actions, attrs=attrs)
6366

6467
opponent_actions = [C] * 2 + [D] + [C] * 10
6568
opponent = axl.MockPlayer(actions=opponent_actions)
66-
expected = ([(C, C)] * 2 + [(C, D)] + [(D, C)] * 10) * 3
67-
self.versus_test(opponent, expected_actions=expected)
69+
actions = ([(C, C)] * 2 + [(C, D)] + [(D, C)] * 10) * 3
70+
attrs = {'grudged': True, 'mem_length': 10, 'grudge_memory': 10}
71+
self.versus_test(opponent, expected_actions=actions, attrs=attrs)
6872

6973
def test_reset_method(self):
7074
"""Tests the reset method."""

0 commit comments

Comments
 (0)