Ejemplo n.º 1
0
 def test_strategy(self):
     """
     Will defect against nice strategies
     """
     p1 = axelrod.ProtectedMindReader()
     p2 = axelrod.Cooperator()
     self.assertEqual(p1.strategy(p2), D)
Ejemplo n.º 2
0
 def test_vs_defect(self):
     """
     Will defect against pure defecting strategies
     """
     p1 = axelrod.ProtectedMindReader()
     p2 = axelrod.Defector()
     self.assertEqual(p1.strategy(p2), D)
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    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')