Ejemplo n.º 1
0
 def test_SDL_LogGetSetPriority(self):
     self.assertEqual(log.SDL_LogGetPriority
                      (log.SDL_LOG_CATEGORY_APPLICATION),
                      log.SDL_LOG_PRIORITY_VERBOSE)
     self.assertEqual(log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_SYSTEM),
                      log.SDL_LOG_PRIORITY_VERBOSE)
     self.assertEqual(log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_CUSTOM),
                      log.SDL_LOG_PRIORITY_VERBOSE)
     log.SDL_LogSetPriority(log.SDL_LOG_CATEGORY_CUSTOM,
                            log.SDL_LOG_PRIORITY_INFO)
     self.assertEqual(log.SDL_LogGetPriority
                      (log.SDL_LOG_CATEGORY_APPLICATION),
                      log.SDL_LOG_PRIORITY_VERBOSE)
     self.assertEqual(log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_SYSTEM),
                      log.SDL_LOG_PRIORITY_VERBOSE)
     self.assertEqual(log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_CUSTOM),
                      log.SDL_LOG_PRIORITY_INFO)
     log.SDL_LogSetPriority(log.SDL_LOG_CATEGORY_SYSTEM,
                            log.SDL_LOG_PRIORITY_ERROR)
     self.assertEqual(log.SDL_LogGetPriority
                      (log.SDL_LOG_CATEGORY_APPLICATION),
                      log.SDL_LOG_PRIORITY_VERBOSE)
     self.assertEqual(log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_SYSTEM),
                      log.SDL_LOG_PRIORITY_ERROR)
     self.assertEqual(log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_CUSTOM),
                      log.SDL_LOG_PRIORITY_INFO)
Ejemplo n.º 2
0
    def test_SDL_LogSetAllPriority(self):
        assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_APPLICATION) == \
                                      log.SDL_LOG_PRIORITY_VERBOSE
        assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_SYSTEM) == \
                                      log.SDL_LOG_PRIORITY_VERBOSE
        log.SDL_LogSetAllPriority(log.SDL_LOG_PRIORITY_WARN)
        assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_APPLICATION) == \
                                      log.SDL_LOG_PRIORITY_WARN
        assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_SYSTEM) == \
                                      log.SDL_LOG_PRIORITY_WARN
        # self.assertRaises(ValueError, log.SDL_LogSetAllPriority, 123)
        # self.assertRaises(TypeError, log.SDL_LogSetAllPriority, None)
        # self.assertRaises(TypeError, log.SDL_LogSetAllPriority, "test")

        # Reset to the setUp() value, so other tests do not fail
        log.SDL_LogSetAllPriority(log.SDL_LOG_PRIORITY_VERBOSE)
Ejemplo n.º 3
0
    def test_SDL_LogResetPriorities(self):
        # set in setUp()
        defpriority = log.SDL_LOG_PRIORITY_VERBOSE
        categories = (log.SDL_LOG_CATEGORY_APPLICATION,
                      log.SDL_LOG_CATEGORY_ERROR, log.SDL_LOG_CATEGORY_SYSTEM,
                      log.SDL_LOG_CATEGORY_AUDIO, log.SDL_LOG_CATEGORY_VIDEO,
                      log.SDL_LOG_CATEGORY_RENDER, log.SDL_LOG_CATEGORY_INPUT,
                      log.SDL_LOG_CATEGORY_CUSTOM)
        for cat in categories:
            priority = log.SDL_LogGetPriority(cat)
            assert priority == defpriority

        log.SDL_LogResetPriorities()
        for cat in categories:
            priority = log.SDL_LogGetPriority(cat)
            assert priority != defpriority

        log.SDL_LogSetAllPriority(log.SDL_LOG_PRIORITY_VERBOSE)
Ejemplo n.º 4
0
 def test_SDL_LogGetSetPriority(self):
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_APPLICATION) == \
                                   log.SDL_LOG_PRIORITY_VERBOSE
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_SYSTEM) == \
                                   log.SDL_LOG_PRIORITY_VERBOSE
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_CUSTOM) == \
                                   log.SDL_LOG_PRIORITY_VERBOSE
     log.SDL_LogSetPriority(log.SDL_LOG_CATEGORY_CUSTOM,
                            log.SDL_LOG_PRIORITY_INFO)
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_APPLICATION) == \
                                   log.SDL_LOG_PRIORITY_VERBOSE
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_SYSTEM) == \
                                   log.SDL_LOG_PRIORITY_VERBOSE
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_CUSTOM) == \
                                   log.SDL_LOG_PRIORITY_INFO
     log.SDL_LogSetPriority(log.SDL_LOG_CATEGORY_SYSTEM,
                            log.SDL_LOG_PRIORITY_ERROR)
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_APPLICATION) == \
                                   log.SDL_LOG_PRIORITY_VERBOSE
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_SYSTEM) == \
                                   log.SDL_LOG_PRIORITY_ERROR
     assert log.SDL_LogGetPriority(log.SDL_LOG_CATEGORY_CUSTOM) == \
                                   log.SDL_LOG_PRIORITY_INFO