@@ -21,13 +21,18 @@ class TestHandshake(TestPlayer):
21
21
}
22
22
23
23
def test_strategy (self ):
24
- # Test initial play sequence
25
- self .responses_test ([ C , D ] )
24
+ # Test first play
25
+ self .first_play_test ( C )
26
26
27
- self .responses_test ([C ] * 20 , [C , D ], [C , D ])
28
- self .responses_test ([D ] * 20 , [C , D ], [C , C ])
29
- self .responses_test ([D ] * 20 , [C , D ], [D , C ])
30
- self .responses_test ([D ] * 20 , [C , D ], [D , D ])
27
+ actions = [(C , C ), (D , D )] + [(C , C ), (C , D )] * 10
28
+ self .versus_test (axelrod .Alternator (), expected_actions = actions )
31
29
32
- self .responses_test ([D ], [C , D ] * 2 , [D , C ] * 2 )
33
- self .responses_test ([C ], [C , D ] * 2 , [C , D ] * 2 )
30
+ actions = [(C , C ), (D , C )] + [(D , C )] * 20
31
+ self .versus_test (axelrod .Cooperator (), expected_actions = actions )
32
+
33
+ opponent = axelrod .MockPlayer ([D , C ])
34
+ actions = [(C , D ), (D , C )] + [(D , D ), (D , C )] * 10
35
+ self .versus_test (opponent , expected_actions = actions )
36
+
37
+ actions = [(C , D ), (D , D )] + [(D , D )] * 20
38
+ self .versus_test (axelrod .Defector (), expected_actions = actions )
0 commit comments