Changeset 6754 for main/waeup.sirp/trunk/src/waeup/sirp/utils/tests
- Timestamp:
- 14 Sep 2011, 00:48:11 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_logger.py
r6748 r6754 8 8 from zope.interface.verify import verifyClass, verifyObject 9 9 from waeup.sirp.app import University 10 from waeup.sirp.testing import ( 11 FunctionalLayer, FunctionalTestCase, get_all_loggers, 12 remove_new_loggers, remove_logger) 10 from waeup.sirp.testing import FunctionalLayer, FunctionalTestCase 13 11 14 12 from waeup.sirp.utils.logger import ( … … 259 257 def setUp(self): 260 258 super(LoggerCollectorTests, self).setUp() 261 self.old_loggers = get_all_loggers()262 259 # Setup a sample site for each test 263 260 app = University() … … 281 278 def tearDown(self): 282 279 super(LoggerCollectorTests, self).tearDown() 283 remove_new_loggers(self.old_loggers)284 280 shutil.rmtree(self.workdir) 285 281 shutil.rmtree(self.dc_root) … … 357 353 def setUp(self): 358 354 super(LogfileChangeTests, self).setUp() 359 remove_logger('waeup.sirp.app') # In case it lingers around360 self.old_loggers = get_all_loggers()361 355 # Setup a sample site for each test 362 356 app = University() … … 373 367 self.component = self.app['mycomponent'] 374 368 setSite(self.app) 375 376 369 self.component = LoggingComponent() 377 370 return … … 379 372 def tearDown(self): 380 373 super(LogfileChangeTests, self).tearDown() 381 remove_new_loggers(self.old_loggers)382 374 shutil.rmtree(self.workdir) 383 375 shutil.rmtree(self.dc_root) … … 397 389 self.assertTrue(filename2.startswith(self.dc_root_new)) 398 390 return 391 392 def test_storage_deletion(self): 393 # When a site is deleted, the loggers should go away as well 394 self.dc_root_new = tempfile.mkdtemp() 395 logger1 = self.component.logger.handlers # create entry in collector 396 collector = queryUtility(ILoggerCollector) 397 loggers1 = collector.keys() 398 root = self.app.__parent__ 399 del root['app'] 400 loggers2 = collector.keys() 401 self.assertEqual(loggers1, ['app']) 402 self.assertEqual(loggers2, []) 403 return
Note: See TracChangeset for help on using the changeset viewer.