def test_exceptions_are_surpressed(self): mock_ipy = mock.MagicMock() mock_ipydb = self.mock_ipy_magic('get_ipydb') mock_ipydb.debug = False mock_ipy.magic.return_value = mock_ipydb def kaboom(*args, **kw): raise Exception('ka ka ka boo boo booom!') mock_ipydb.completer = mock.MagicMock() mock_ipydb.completer.complete = mock.MagicMock(side_effect=kaboom) completion.ipydb_complete( mock_ipy, Event(line='select fo', command='select', symbol='fo', text_until_cursor='select fo'))
def test_ipydb_complete(self): mock_ipy = mock.MagicMock() mock_ipy.magic = mock.MagicMock(side_effect=self.mock_ipy_magic) result = completion.ipydb_complete( mock_ipy, Event(line='select fo', command='select', symbol='fo', text_until_cursor='select fo')) nt.assert_true('foo', result)