Exemple #1
0
 def test_score_personality(self):
     k = models.BuildingKind(name='per')
     b = models.Building(kind=k)
     with mock.patch.object(models.Building, 'effect') as mock_effect:
         mock_effect.get_score.return_value = 42
         score = b.score(
             None, None, None
         )  # using None as players, because the mock effect does not care
     self.assertEqual(
         score,
         models.Score(treasury=0,
                      military=0,
                      special=0,
                      civilian=0,
                      economy=0,
                      science=0,
                      personality=42))
Exemple #2
0
 def test_total(self):
     s = models.Score(4, 6, 8, 10, 5, 7, 9)
     result = s.total()
     self.assertEqual(result, 49)
Exemple #3
0
 def test_add(self):
     s2 = models.Score(1, 3, 5, 7, 2, 4, 6)
     s3 = models.Score(3, 3, 3, 3, 3, 3, 3)
     result = self.score + s2 + s3
     self.assertEqual(result, (4, 6, 8, 10, 5, 7, 9))