Exemplo n.º 1
0
    def testBasics(self):
        def getFramerate():
            framerate = player.getEffectiveFramerate()
            self.assert_(framerate > 0)
            self.assert_(player.getVideoRefreshRate() > 0)

        def invalidCreateNode():
            avg.ImageNode(1, 2, 3)

        player.showCursor(0)
        self.assert_(not (player.isCursorShown()))
        player.showCursor(1)
        self.assert_(player.isCursorShown())
        root = self.loadEmptyScene()
        avg.ImageNode(href="rgb24-65x65.png", parent=root)
        self.assertEqual(root.getChild(0).getParent(), root)
        self.assertEqual(root.getChild(0).parent, root)
        self.assertRaises(avg.Exception, invalidCreateNode)
        self.start(False, (
            getFramerate,
            lambda: self.compareImage("testbasics"),
            lambda: player.setGamma(0.3, 0.3, 0.3),
            lambda: player.showCursor(0),
            lambda: self.assert_(not (player.isCursorShown())),
            lambda: player.showCursor(1),
        ))
Exemplo n.º 2
0
    def testBasics(self):
        def getFramerate():
            framerate = player.getEffectiveFramerate()
            self.assert_(framerate > 0)
            self.assert_(player.getVideoRefreshRate() > 0)

        def invalidCreateNode():
            avg.ImageNode(1, 2, 3)

        player.showCursor(0)
        self.assert_(not(player.isCursorShown()))
        player.showCursor(1)
        self.assert_(player.isCursorShown())
        root = self.loadEmptyScene()
        avg.ImageNode(href="rgb24-65x65.png", parent=root)
        self.assertEqual(root.getChild(0).getParent(), root)
        self.assertEqual(root.getChild(0).parent, root)
        self.assertRaises(avg.Exception, invalidCreateNode)
        self.start(False,
                (getFramerate,
                 lambda: self.compareImage("testbasics"), 
                 lambda: player.setGamma(0.3, 0.3, 0.3),
                 lambda: player.showCursor(0),
                 lambda: self.assert_(not(player.isCursorShown())),
                 lambda: player.showCursor(1),
                ))