Changeset 6581 for main/waeup.sirp/trunk


Ignore:
Timestamp:
7 Aug 2011, 16:12:33 (13 years ago)
Author:
uli
Message:

Bring test coverage for loggers to 100%. That doesn't fix the
regression problem with problems on site creation, though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_logger.py

    r6578 r6581  
    182182        return
    183183
     184    def test_logger_additional_handlers(self):
     185        # When we detect additional handlers in a logger, setup anew.
     186        setSite(self.app)
     187        logger = Logger()
     188        old_py_logger = logger.logger
     189        handler = logging.StreamHandler()
     190        logger.logger.addHandler(handler)
     191        old_handler_num = len(old_py_logger.handlers)
     192        new_py_logger = logger.logger  # This should detect new handler
     193        new_handler_num = len(new_py_logger.handlers)
     194        self.assertEqual(new_handler_num, 1)
     195        self.assertTrue(isinstance(
     196                new_py_logger.handlers[0],
     197                logging.handlers.RotatingFileHandler))
    184198
    185199class LoggersFunctionalTests(FunctionalTestCase):
Note: See TracChangeset for help on using the changeset viewer.