[tests] Make tests pass again

This commit is contained in:
Tobias Witek 2020-02-23 14:55:13 +01:00
parent 5e673482d3
commit fd57af9325
2 changed files with 4 additions and 3 deletions

View file

@ -17,7 +17,8 @@ class module(unittest.TestCase):
self.anotherWidget = core.widget.Widget('more Widget content')
def test_loadinvalid_module(self):
module = core.module.load(module_name=self.invalidModuleName)
config = unittest.mock.MagicMock()
module = core.module.load(module_name=self.invalidModuleName, config=config)
self.assertEqual('core.module', module.__class__.__module__, 'module must be a module object')
self.assertEqual('Error', module.__class__.__name__, 'an invalid module must be a core.module.Error')

View file

@ -28,11 +28,11 @@ class widget(unittest.TestCase):
def test_callable_fulltext(self):
newWidget = core.widget.Widget(full_text=self.someCallback)
self.assertEqual(newWidget.full_text(), self.callbackReturnValue)
self.someCallback.assert_called_once_with()
self.someCallback.assert_called_once_with(newWidget)
def test_set_callable_fulltext(self):
self.someWidget.full_text(self.someCallback)
self.assertEqual(self.someWidget.full_text(), self.callbackReturnValue)
self.someCallback.assert_called_once_with()
self.someCallback.assert_called_once_with(self.someWidget)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4