def test_strategy(self): """ Will defect against nice strategies """ p1 = axelrod.ProtectedMindReader() p2 = axelrod.Cooperator() self.assertEqual(p1.strategy(p2), D)
def test_vs_defect(self): """ Will defect against pure defecting strategies """ p1 = axelrod.ProtectedMindReader() p2 = axelrod.Defector() self.assertEqual(p1.strategy(p2), D)
def tests_protected(self): """Ensures that no other player can alter its strategy """ p1 = axelrod.ProtectedMindReader() p2 = axelrod.MindController() P3 = axelrod.Cooperator() p2.strategy(p1) self.assertEqual(p1.strategy(P3), D)
def tests_protected_mind_reader(self): """Ensures that no other player can alter its strategy """ P1 = axelrod.ProtectedMindReader() P2 = axelrod.MindController() P3 = axelrod.Cooperator() P2.strategy(P1) self.assertEqual(P1.strategy(P3), 'D')