Skip to content
Snippets Groups Projects
Commit 7742fb56 authored by lukas leufen's avatar lukas leufen
Browse files

add an additional test fkt to check if ecorrect error is raised #68

/close #68

See merge request toar/machinelearningtools!60
parents c11e6bcb f2253185
No related branches found
No related tags found
2 merge requests!60add an additional test fkt to check if ecorrect error is raised #68,!59Develop
Pipeline #31276 passed
...@@ -179,6 +179,13 @@ class TestCallbackHandler: ...@@ -179,6 +179,13 @@ class TestCallbackHandler:
{"name": "other_clbk", "other_clbk": "callback_other", {"name": "other_clbk", "other_clbk": "callback_other",
"path": "otherpath"}] "path": "otherpath"}]
def test_add_callback_raise(self, clbk_handler):
clbk_handler.editable = False
with pytest.raises(PermissionError) as einfo:
clbk_handler.add_callback("callback_new_instance", "this_path")
assert 'CallbackHandler is protected and cannot be edited.' in str(einfo.value)
def test_get_callbacks_as_dict(self, clbk_handler_with_dummies): def test_get_callbacks_as_dict(self, clbk_handler_with_dummies):
clbk = clbk_handler_with_dummies clbk = clbk_handler_with_dummies
assert clbk.get_callbacks() == [{"callback": "callback_new_instance", "path": "this_path"}, assert clbk.get_callbacks() == [{"callback": "callback_new_instance", "path": "this_path"},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment