'Does Brain correctly log errors when raised by modules?'

def testLog(self):

    my_brain = TestBrain._emptyBrain()
    unclear = my_brain.modules[(-1)]
    with mock.patch.object(unclear, 'handle') as mocked_handle:
        with mock.patch.object(my_brain._logger, 'error') as mocked_log:
            mocked_handle.side_effect = KeyError('foo')
            my_brain.query('zzz    gibberish    zzz')
            self.assertTrue(mocked_log.called)
