Ejemplo n.º 1
0
class TestAIQualityMethods(TestCase):
    def setUp(self):
        self.co_master_0 = SMVETreeCOMaseterFactory()
        self.co_master_1 = SMVETreeCOMaseterFactory(profile=self.co_master_0.profile)

    def test_set_ai_q_for_all_ais(self):
        """Setting COMaster AI's q should not affect other AIs in other COMasters"""
        self.co_master_0.ais.update(q=0)
        self.co_master_1.ais.update(q=1)
        value = 1
        self.co_master_0.set_ai_qualifier(value=value)
        values = self.co_master_0.ais.values_list("q", flat=True)
        for v in values:
            self.assertEqual(v, value, "q should have been set to %s" % value)

        values = self.co_master_0.ais.values_list("q", flat=True)
        for v in values:
            self.assertEqual(v, 1, "q should not have been modified")
Ejemplo n.º 2
0
class TestAIQualityMethods(TestCase):
    def setUp(self):
        self.co_master_0 = SMVETreeCOMaseterFactory()
        self.co_master_1 = SMVETreeCOMaseterFactory(
            profile=self.co_master_0.profile)

    def test_set_ai_q_for_all_ais(self):
        '''Setting COMaster AI's q should not affect other AIs in other COMasters'''
        self.co_master_0.ais.update(q=0)
        self.co_master_1.ais.update(q=1)
        value = 1
        self.co_master_0.set_ai_qualifier(value=value)
        values = self.co_master_0.ais.values_list('q', flat=True)
        for v in values:
            self.assertEqual(v, value, "q should have been set to %s" % value)

        values = self.co_master_0.ais.values_list('q', flat=True)
        for v in values:
            self.assertEqual(v, 1, "q should not have been modified")
Ejemplo n.º 3
0
 def setUp(self):
     self.co_master_0 = SMVETreeCOMaseterFactory()
     self.co_master_1 = SMVETreeCOMaseterFactory(
         profile=self.co_master_0.profile)
Ejemplo n.º 4
0
 def setUp(self):
     self.co_master_0 = SMVETreeCOMaseterFactory()
     self.co_master_1 = SMVETreeCOMaseterFactory(profile=self.co_master_0.profile)