Example #1
0
    def test_screensaver(self):
        initial = video.SDL_IsScreenSaverEnabled()
        assert initial in (SDL_FALSE, SDL_TRUE)

        video.SDL_EnableScreenSaver()
        assert video.SDL_IsScreenSaverEnabled() == SDL_TRUE
        video.SDL_EnableScreenSaver()
        assert video.SDL_IsScreenSaverEnabled() == SDL_TRUE
        video.SDL_DisableScreenSaver()
        assert video.SDL_IsScreenSaverEnabled() == SDL_FALSE
        video.SDL_DisableScreenSaver()
        assert video.SDL_IsScreenSaverEnabled() == SDL_FALSE
        video.SDL_EnableScreenSaver()
        assert video.SDL_IsScreenSaverEnabled() == SDL_TRUE
        video.SDL_DisableScreenSaver()
        assert video.SDL_IsScreenSaverEnabled() == SDL_FALSE

        if initial == SDL_TRUE:
            video.SDL_EnableScreenSaver()
        else:
            video.SDL_DisableScreenSaver()
Example #2
0
    def test_screensaver(self):
        initial = video.SDL_IsScreenSaverEnabled()
        self.assertIn(initial, (SDL_FALSE, SDL_TRUE))

        video.SDL_EnableScreenSaver()
        self.assertEqual(video.SDL_IsScreenSaverEnabled(), SDL_TRUE)
        video.SDL_EnableScreenSaver()
        self.assertEqual(video.SDL_IsScreenSaverEnabled(), SDL_TRUE)
        video.SDL_DisableScreenSaver()
        self.assertEqual(video.SDL_IsScreenSaverEnabled(), SDL_FALSE)
        video.SDL_DisableScreenSaver()
        self.assertEqual(video.SDL_IsScreenSaverEnabled(), SDL_FALSE)
        video.SDL_EnableScreenSaver()
        self.assertEqual(video.SDL_IsScreenSaverEnabled(), SDL_TRUE)
        video.SDL_DisableScreenSaver()
        self.assertEqual(video.SDL_IsScreenSaverEnabled(), SDL_FALSE)

        if initial == SDL_TRUE:
            video.SDL_EnableScreenSaver()
        else:
            video.SDL_DisableScreenSaver()