File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11from axelrod_fortran .strategies import all_strategies
22from axelrod_fortran .player import Player
3+ from axelrod import Alternator , Cooperator , Defector , Match
4+ from axelrod .action import Action
35from ctypes import c_int , c_float , POINTER
46
57from hypothesis import given
68from hypothesis .strategies import integers
79
10+ C , D = Action .C , Action .D
11+
812
913def test_init ():
1014 for strategy in all_strategies :
@@ -33,3 +37,13 @@ def test_original_strategy(
3337 if action not in (0 , 1 ):
3438 print (f'{ strategy } returned { action } ' )
3539 assert action in (0 , 1 )
40+
41+
42+ def test_matches ():
43+ for strategy in all_strategies :
44+ for opponent in (Alternator , Cooperator , Defector ):
45+ players = (Player (strategy ), opponent ())
46+ match = Match (players , 50 )
47+ assert all (
48+ action in (C , D ) for interaction in match .play ()
49+ for action in interaction )
You can’t perform that action at this time.
0 commit comments