Beispiel #1
0
 def test_start(self):
     yield self.assert_status('stopped')
     lc = LogCatcher()
     with lc:
         yield self.rtr_helper.start_router(self.router)
     self.assertEqual(lc.messages(), [
         u"Starting router '%s' for user 'test-0-user'." % self.router.key,
     ])
     yield self.assert_status('running')
Beispiel #2
0
 def test_start(self):
     yield self.assert_status('stopped')
     lc = LogCatcher()
     with lc:
         yield self.rtr_helper.start_router(self.router)
     self.assertEqual(lc.messages(), [
         u"Starting router '%s' for user 'test-0-user'." % self.router.key,
     ])
     yield self.assert_status('running')
Beispiel #3
0
 def test_message_concatenation(self):
     lc = LogCatcher()
     with lc:
         log.info("Part 1", "Part 2")
     self.assertEqual(lc.messages(), ["Part 1 Part 2"])
Beispiel #4
0
 def test_message_filtering(self):
     lc = LogCatcher(message="^Keep")
     with lc:
         log.info("Keep this")
         log.info("Discard this")
     self.assertEqual(lc.messages(), ["Keep this"])
Beispiel #5
0
 def test_system_filtering(self):
     lc = LogCatcher(system="^ab")
     with lc:
         log.info("Test 1", system="abc")
         log.info("Test 2", system="def")
     self.assertEqual(lc.messages(), ["Test 1"])
Beispiel #6
0
 def test_simple_catching(self):
     lc = LogCatcher()
     with lc:
         log.info("Test")
     self.assertEqual(lc.messages(), ["Test"])
Beispiel #7
0
 def test_message_concatenation(self):
     lc = LogCatcher()
     with lc:
         log.info("Part 1", "Part 2")
     self.assertEqual(lc.messages(), ["Part 1 Part 2"])
Beispiel #8
0
 def test_message_filtering(self):
     lc = LogCatcher(message="^Keep")
     with lc:
         log.info("Keep this")
         log.info("Discard this")
     self.assertEqual(lc.messages(), ["Keep this"])
Beispiel #9
0
 def test_system_filtering(self):
     lc = LogCatcher(system="^ab")
     with lc:
         log.info("Test 1", system="abc")
         log.info("Test 2", system="def")
     self.assertEqual(lc.messages(), ["Test 1"])
Beispiel #10
0
 def test_simple_catching(self):
     lc = LogCatcher()
     with lc:
         log.info("Test")
     self.assertEqual(lc.messages(), ["Test"])