Skip to content

Commit 436e821

Browse files
committed
fixes coverage failure.
Added a test that checks that the condition least 20 rounds since the last ‘fresh start’ kicks in.
1 parent a3c437e commit 436e821

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

axelrod/tests/strategies/test_axelrod_first.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,4 +523,18 @@ def test_strategy(self):
523523
self.versus_test(opponent, expected_actions=actions,
524524
attrs={'fresh_start': False})
525525

526+
# check the fresh start condition: least 20 rounds since the last ‘fresh start’
527+
opponent = axelrod.Cycler('CCCCD')
528+
actions = [(C, C), (C, C), (C, C), (C, C), (C, D), (D, C), (C, C),
529+
(C, C), (C, C), (C, D), (D, C), (D, C), (C, C), (C, C),
530+
(C, D), (D, C), (D, C), (D, C), (C, C), (C, D), (D, C),
531+
(D, C), (D, C), (C, C), (C, D), (D, C), (C, C), (C, C),
532+
(C, C), (C, D), (D, C), (D, C), (C, C), (C, C), (C, D)]
533+
self.versus_test(opponent, expected_actions=actions,
534+
match_attributes={'length': 35},
535+
attrs={'current_score': 108, 'opponent_score': 78,
536+
'last_fresh_start': 24,
537+
'retaliation_length': 2,
538+
'retaliation_remaining': 0})
539+
526540

0 commit comments

Comments
 (0)