Esempio n. 1
0
    def test_SpriteRenderSystem_sortfunc(self):
        def func(p):
            pass

        renderer = sdl2ext.SpriteRenderSystem()
        self.assertIsNotNone(renderer.sortfunc)
        renderer.sortfunc = func
        self.assertEqual(renderer.sortfunc, func)

        def setf(x, f):
            x.sortfunc = f
        self.assertRaises(TypeError, setf, renderer, None)
        self.assertRaises(TypeError, setf, renderer, "Test")
        self.assertRaises(TypeError, setf, renderer, 1234)
    def test_SpriteRenderSystem_sortfunc(self):
        def func(p):
            pass

        renderer = sdl2ext.SpriteRenderSystem()
        assert renderer.sortfunc is not None
        renderer.sortfunc = func
        assert renderer.sortfunc == func

        def setf(x, f):
            x.sortfunc = f

        with pytest.raises(TypeError):
            setf(renderer, None)
        with pytest.raises(TypeError):
            setf(renderer, "Test")
        with pytest.raises(TypeError):
            setf(renderer, 1234)
 def test_SpriteRenderSystem(self):
     renderer = sdl2ext.SpriteRenderSystem()
     self.assertIsInstance(renderer, sdl2ext.SpriteRenderSystem)
     self.assertIsNotNone(renderer.sortfunc)
     self.assertTrue(sdl2ext.Sprite in renderer.componenttypes)
 def test_SpriteRenderSystem(self):
     renderer = sdl2ext.SpriteRenderSystem()
     assert isinstance(renderer, sdl2ext.SpriteRenderSystem)
     assert renderer.sortfunc is not None
     assert sdl2ext.Sprite in renderer.componenttypes