示例#1
0
    def testTroopColorSpriteMethodCallsSurfaceFillMethod(self):
        unit = Troop()
        unit.createImage()
        unit.image = Mock()
        unit.colorSprite((0,0,0))

        unit.image.fill.assert_called_once_with((0,0,0))
示例#2
0
    def testTroopGetImageForManuallyAssignedImageReturnsCorrectImage(self):
        unit = Troop()
        image = pygame.Surface((10,10))
        unit.image = image

        self.assertEqual(unit.getImage(), unit.image)