fix: fix 'duplicate-code' for pylint
This commit is contained in:
parent
ad74bede04
commit
a1868e1f44
10 changed files with 233 additions and 129 deletions
|
@ -1371,6 +1371,25 @@ class TestMasterView(WebTestCase):
|
|||
self.session.commit()
|
||||
self.assertEqual(self.session.query(model.Setting).count(), 7)
|
||||
|
||||
def test_do_thread_body(self):
|
||||
view = self.make_view()
|
||||
|
||||
# nb. so far this is just proving coverage, in case caller
|
||||
# does not specify an error handler
|
||||
|
||||
def func():
|
||||
raise RuntimeError
|
||||
|
||||
# with error handler
|
||||
onerror = MagicMock()
|
||||
view.do_thread_body(func, (), {}, onerror)
|
||||
onerror.assert_called_once_with()
|
||||
|
||||
# without error handler
|
||||
onerror.reset_mock()
|
||||
view.do_thread_body(func, (), {})
|
||||
onerror.assert_not_called()
|
||||
|
||||
def test_delete_bulk_thread(self):
|
||||
self.pyramid_config.add_route("settings", "/settings/")
|
||||
model = self.app.model
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue