From 3468543f0e528115bc28540092d1670c1163537d Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 24 Sep 2014 10:52:07 +0200 Subject: Fix brain logging test --- client/test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/test.py b/client/test.py index 0160b76..184a777 100644 --- a/client/test.py +++ b/client/test.py @@ -198,15 +198,15 @@ class TestBrain(unittest.TestCase): profile = DEFAULT_PROFILE return brain.Brain(mic, profile) - @patch.object(brain, 'logError') - def testLog(self, logError): + def testLog(self): """Does Brain correctly log errors when raised by modules?""" my_brain = TestBrain._emptyBrain() unclear = my_brain.modules[-1] with patch.object(unclear, 'handle') as mocked_handle: - mocked_handle.side_effect = KeyError('foo') - my_brain.query("zzz gibberish zzz") - logError.assert_called_with() + with patch.object(my_brain._logger, 'error') as mocked_loggingcall: + mocked_handle.side_effect = KeyError('foo') + my_brain.query("zzz gibberish zzz") + self.assertTrue(mocked_loggingcall.called) def testSortByPriority(self): """Does Brain sort modules by priority?""" -- cgit v1.3.1