Skip to content

Commit c879bed

Browse files
souravsinghdrvinceknight
authored andcommitted
Add test for EugineNier
1 parent b7685c5 commit c879bed

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

axelrod/tests/strategies/test_titfortat.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,3 +600,40 @@ def test_strategy(self):
600600
opponent = axelrod.MockPlayer(actions=[C, C, D, D, C, D])
601601
actions = [(C, C), (C, C), (C, D), (D, D), (D, C), (D, D)]
602602
self.versus_test(opponent, expected_actions=actions)
603+
604+
class TestEugineNier(TestPlayer):
605+
"""
606+
Tests for the EugineNier strategy
607+
"""
608+
609+
name = "EugineNier: ('D',)"
610+
player = axelrod.EugineNier
611+
expected_classifier = {
612+
'memory_depth': float('inf'),
613+
'stochastic': False,
614+
'makes_use_of': {'length'},
615+
'inspects_source': False,
616+
'manipulates_source': False,
617+
'manipulates_state': False
618+
}
619+
620+
def test_strategy(self):
621+
self.first_play_test(C)
622+
self.second_play_test(rCC=C, rCD=D, rDC=C, rDD=D)
623+
624+
actions = [(C, C), (C, C), (C, C), (C, C), (D, C)]
625+
self.versus_test(axelrod.Cooperator(), expected_actions=actions)
626+
627+
actions = [(C, D), (D, D), (D, D), (D, D), (D, D)]
628+
self.versus_test(axelrod.Defector(), expected_actions=actions)
629+
630+
actions = [(C, C), (C, D), (D, C), (C, D), (D, C), (C, D)]
631+
self.versus_test(axelrod.Alternator(), expected_actions=actions,
632+
match_attributes={"length": -1})
633+
634+
actions = [(C, C), (C, D), (D, C), (C, D), (D, C), (D, D)]
635+
self.versus_test(axelrod.Alternator(), expected_actions=actions)
636+
637+
opponent = axelrod.MockPlayer(actions=[C, C, D, D, C, D])
638+
actions = [(C, C), (C, C), (C, D), (D, D), (D, C), (D, D)]
639+
self.versus_test(opponent, expected_actions=actions)

0 commit comments

Comments
 (0)