Пример #1
0
    def test_not_debug(self, mock_set_level, mock_init_logging):
        self.app.config['DEBUG'] = False

        app.set_log_level(self.app)

        # make sure it did not change the log level
        self.assertEqual(mock_set_level.call_count, 0)
Пример #2
0
    def test_debug(self, mock_set_level, mock_init_logging):
        self.app.config['DEBUG'] = True

        app.set_log_level(self.app)

        # make sure it set the level to debug
        mock_set_level.assert_called_once_with(logging.DEBUG)