Ticket #5311: 5311.diff
File 5311.diff, 1.7 KB (added by , 11 years ago) |
---|
-
twisted/protocols/test/test_tls.py
142 142 143 143 144 144 class TLSMemoryBIOFactoryTests(TestCase): 145 """ 146 Ensure TLSMemoryBIOFactory logging acts correctly. 147 """ 148 149 def test_quiet(self): 150 """ 151 L{TLSMemoryBIOFactory.doStart} and L{TLSMemoryBIOFactory.doStop} do 152 not log any messages. 153 """ 154 logs = [] 155 logger = logs.append 156 log.addObserver(logger) 157 self.addCleanup(log.removeObserver, logger) 158 wrappedFactory = ServerFactory() 159 # Disable logging on the wrapped factory: 160 wrappedFactory.doStart = lambda: None 161 wrappedFactory.doStop = lambda: None 162 factory = TLSMemoryBIOFactory(None, False, wrappedFactory) 163 factory.doStart() 164 factory.doStop() 165 self.assertEqual(logs, []) 166 167 145 168 def test_logPrefix(self): 146 169 """ 147 170 L{TLSMemoryBIOFactory.logPrefix} amends the wrapped factory's log prefix -
twisted/protocols/tls.py
577 577 """ 578 578 protocol = TLSMemoryBIOProtocol 579 579 580 noisy = False # disable unnecessary logging. 581 580 582 def __init__(self, contextFactory, isClient, wrappedFactory): 581 583 WrappingFactory.__init__(self, wrappedFactory) 582 584 self._contextFactory = contextFactory