@@ -717,7 +717,7 @@ def test_strategy(self):
717
717
Defect37 = axelrod .MockPlayer (actions = opponent_actions )
718
718
# Activate the Fair-weather flag
719
719
actions = [(C , C )] * 36 + [(D , D )] + [(C , C )] * 100
720
- self .versus_test (Defect37 , expected_actions = actions )
720
+ self .versus_test (Defect37 , expected_actions = actions , attrs = { "mode" : "Fair-weather" } )
721
721
722
722
# Defect on 37th turn to activate Fair-weather, then later defect to
723
723
# exit Fair-weather
@@ -727,12 +727,12 @@ def test_strategy(self):
727
727
actions += [(C , D )]
728
728
#Immediately exit Fair-weather
729
729
actions += [(D , C ), (C , C ), (D , C ), (C , C )]
730
- self .versus_test (Defect37_big , expected_actions = actions , seed = 2 )
730
+ self .versus_test (Defect37_big , expected_actions = actions , seed = 2 , attrs = { "mode" : "Normal" } )
731
731
actions = [(C , C )] * 36 + [(D , D )] + [(C , C )] * 100
732
732
actions += [(C , D )]
733
733
#Immediately exit Fair-weather
734
734
actions += [(D , C ), (C , C ), (C , C ), (C , C )]
735
- self .versus_test (Defect37_big , expected_actions = actions , seed = 1 )
735
+ self .versus_test (Defect37_big , expected_actions = actions , seed = 1 , attrs = { "mode" : "Normal" } )
736
736
737
737
# Opponent defects on 1st turn
738
738
opponent_actions = [D ] + [C ] * 46
@@ -767,7 +767,7 @@ def test_strategy(self):
767
767
actions += [(C , D ), (C , C )]
768
768
# TFT from then on, since burned
769
769
actions += [(C , C )] * 8
770
- self .versus_test (Defect1_38 , expected_actions = actions , seed = 2 )
770
+ self .versus_test (Defect1_38 , expected_actions = actions , seed = 2 , attrs = { "burned" : True } )
771
771
772
772
# Use alternator to test parity flags.
773
773
actions = [(C , C ), (C , D )]
@@ -804,18 +804,18 @@ def test_strategy(self):
804
804
actions += [(C , D ), (D , C ), (C , D ), (D , C ), (C , D ), (C , C )]
805
805
# Now hit thi limit sooner
806
806
actions += [(C , D ), (D , C ), (C , D ), (C , C )] * 5
807
- self .versus_test (AsyncAlternator , expected_actions = actions )
807
+ self .versus_test (AsyncAlternator , expected_actions = actions , attrs = { "parity_limit" : 3 } )
808
808
809
809
# Use a Defector to test the 20-defect streak
810
810
actions = [(C , D ), (D , D ), (D , D ), (D , D ), (D , D )]
811
811
# Now the two parity flags are used
812
812
actions += [(C , D ), (C , D )]
813
813
# Repeat
814
814
actions += [(D , D ), (D , D ), (D , D ), (D , D ), (C , D ), (C , D )] * 2
815
- actions += [(D , D )]
816
- # 20 D have passed
815
+ actions += [(D , D ), ( D , D ) ]
816
+ # 20 D have passed (first isn't record)
817
817
actions += [(D , D )] * 100
818
818
# The defect streak will always be detected from here on, because it
819
819
# doesn't reset. This logic comes before parity streaks or the turn-
820
820
# based logic.
821
- self .versus_test (axelrod .Defector (), expected_actions = actions )
821
+ self .versus_test (axelrod .Defector (), expected_actions = actions , attrs = { "recorded_defects" : 119 } )
0 commit comments