We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcbcf6f commit 3933658Copy full SHA for 3933658
axelrod/tests/unit/test_titfortat.py
@@ -30,12 +30,20 @@ class TestTitForTat(TestPlayer):
30
}
31
32
def test_strategy(self):
33
- # Starts by cooperating.
34
self.first_play_test(C)
35
- # Repeats last action of opponent history.
36
self.second_play_test(C, D, C, D)
37
- self.responses_test([C], [C] * 4, [C, C, C, C])
38
- self.responses_test([D], [C] * 5, [C, C, C, C, D])
+
+ outcomes = [(C, C), (C, D), (D, C), (C, D)]
+ match = axelrod.Match((self.player(), axelrod.Alternator()), turns=4)
+ self.assertEqual(match.play(), outcomes)
39
40
+ outcomes = [(C, C), (C, C), (C, C), (C, C)]
41
+ match = axelrod.Match((self.player(), axelrod.Cooperator()), turns=4)
42
43
44
+ outcomes = [(C, D), (D, D), (D, D), (D, D)]
45
+ match = axelrod.Match((self.player(), axelrod.Defector()), turns=4)
46
47
48
49
class TestTitFor2Tats(TestPlayer):
0 commit comments