def test_logger_on_connect(self): logger = unittest.mock.Mock() signal = AdHocSignal() signal.logger = logger a = unittest.mock.Mock() signal.connect(a) logger.debug.assert_called_with("connecting %r with mode %r", a, signal.STRONG)
def test_logger_on_connect(self): logger = unittest.mock.Mock() signal = AdHocSignal() signal.logger = logger a = unittest.mock.Mock() signal.connect(a) logger.debug.assert_called_with( "connecting %r with mode %r", a, signal.STRONG)
def test_logger_on_emit_with_exception(self): logger = unittest.mock.Mock() signal = AdHocSignal() signal.logger = logger a = unittest.mock.Mock() signal.connect(a) a.side_effect = Exception() signal() logger.exception.assert_called_with( "listener attached to signal raised")
def test_logger_on_emit_with_exception(self): logger = unittest.mock.Mock() signal = AdHocSignal() signal.logger = logger a = unittest.mock.Mock() signal.connect(a) a.side_effect = Exception() signal() logger.exception.assert_called_with( "listener attached to signal raised" )