Skip to content

Commit

Permalink
Refactor tests for appeaser for #884
Browse files Browse the repository at this point in the history
  • Loading branch information
drvinceknight committed Mar 14, 2017
1 parent 75b5843 commit 82c16f2
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions axelrod/tests/strategies/test_appeaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,17 @@ class TestAppeaser(TestPlayer):
def test_strategy(self):
# Starts by cooperating.
self.first_play_test(C)
self.responses_test([C, C, C], [C], [C])
self.responses_test([D], [C, D, C, D], [C, C, D])
self.responses_test([C], [C, D, C, D, C], [C, C, D, D])
self.responses_test([D], [C, D, C, D, C, D], [C, C, D, D, D])

actions = [(C, C), (C, C), (C, C)]
self.versus_test(axelrod.Cooperator(), expected_actions=actions)

actions = [(C, D), (D, D), (C, D), (D, D)]
self.versus_test(axelrod.Defector(), expected_actions=actions)

opponent = axelrod.MockPlayer([C, C, D, D])
actions = [(C, C), (C, C), (C, D), (D, D), (C, C), (C, C)]
self.versus_test(opponent, expected_actions=actions)

opponent = axelrod.MockPlayer([C, C, D, D, D])
actions = [(C, C), (C, C), (C, D), (D, D), (C, D), (D, C), (D, C)]
self.versus_test(opponent, expected_actions=actions)

0 comments on commit 82c16f2

Please sign in to comment.