Skip to content

Commit ffd44a8

Browse files
committed
Added some attrs arguments to the test file.
1 parent 5e4f4c8 commit ffd44a8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

axelrod/tests/strategies/test_axelrod_second.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ def test_strategy(self):
717717
Defect37 = axelrod.MockPlayer(actions=opponent_actions)
718718
# Activate the Fair-weather flag
719719
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"})
721721

722722
# Defect on 37th turn to activate Fair-weather, then later defect to
723723
# exit Fair-weather
@@ -727,12 +727,12 @@ def test_strategy(self):
727727
actions += [(C, D)]
728728
#Immediately exit Fair-weather
729729
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"})
731731
actions = [(C, C)] * 36 + [(D, D)] + [(C, C)] * 100
732732
actions += [(C, D)]
733733
#Immediately exit Fair-weather
734734
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"})
736736

737737
# Opponent defects on 1st turn
738738
opponent_actions = [D] + [C] * 46
@@ -767,7 +767,7 @@ def test_strategy(self):
767767
actions += [(C, D), (C, C)]
768768
# TFT from then on, since burned
769769
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})
771771

772772
# Use alternator to test parity flags.
773773
actions = [(C, C), (C, D)]
@@ -804,18 +804,18 @@ def test_strategy(self):
804804
actions += [(C, D), (D, C), (C, D), (D, C), (C, D), (C, C)]
805805
# Now hit thi limit sooner
806806
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})
808808

809809
# Use a Defector to test the 20-defect streak
810810
actions = [(C, D), (D, D), (D, D), (D, D), (D, D)]
811811
# Now the two parity flags are used
812812
actions += [(C, D), (C, D)]
813813
# Repeat
814814
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)
817817
actions += [(D, D)] * 100
818818
# The defect streak will always be detected from here on, because it
819819
# doesn't reset. This logic comes before parity streaks or the turn-
820820
# 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

Comments
 (0)