@@ -192,32 +192,22 @@ def test_strategy(self):
192
192
opponent .history = [C , D ]
193
193
self .assertEqual (player .strategy (opponent ), D )
194
194
195
- def test_random_defection (self ):
196
- # Random defection
197
- player = self .player (0.4 )
198
- opponent = axelrod .Random ()
199
- test_responses (self , player , opponent , [C ], [C ], [D ], random_seed = 1 )
200
-
201
195
def test_remorse (self ):
202
196
"""After probing, if opponent retaliates, will offer a C"""
203
197
player = self .player (0.4 )
204
- opponent = axelrod .Random ()
198
+ opponent = axelrod .Cooperator ()
205
199
206
- random .seed (0 )
207
- player .history = [C ]
208
- opponent .history = [C ]
209
- self .assertEqual (player .strategy (opponent ), D ) # Random defection
210
- self .assertEqual (player .probing , True )
200
+ test_responses (self , player , opponent , [C ], [C ], [C ],
201
+ random_seed = 0 , attrs = {'probing' : False })
211
202
212
- player .history = [C , D ]
213
- opponent .history = [C , D ]
214
- self .assertEqual (player .strategy (opponent ), C ) # Remorse
215
- self .assertEqual (player .probing , False )
203
+ test_responses (self , player , opponent , [C ], [C ], [D ],
204
+ random_seed = 1 , attrs = {'probing' : True })
216
205
217
- player .history = [C , D , C ]
218
- opponent .history = [C , D , D ]
219
- self .assertEqual (player .strategy (opponent ), D )
220
- self .assertEqual (player .probing , False )
206
+ test_responses (self , player , opponent , [C , D ], [C , D ], [D ],
207
+ attrs = {'probing' : False })
208
+
209
+ test_responses (self , player , opponent , [C , D , C ], [C , D , D ], [D ],
210
+ attrs = {'probing' : False })
221
211
222
212
def test_reduction_to_TFT (self ):
223
213
player = self .player (0 )
@@ -236,3 +226,9 @@ def test_reset_probing(self):
236
226
player .probing = True
237
227
player .reset ()
238
228
self .assertFalse (player .probing )
229
+
230
+ def test_random_defection (self ):
231
+ # Random defection
232
+ player = self .player (0.4 )
233
+ opponent = axelrod .Random ()
234
+ test_responses (self , player , opponent , [C ], [C ], [D ], random_seed = 1 )
0 commit comments