Skip to content

Commit b08af92

Browse files
committed
Add test_save_script_parameters_fail
1 parent cb793b4 commit b08af92

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"bdvp",
1616
"bigstitcher",
1717
"biop",
18+
"caplog",
1819
"clij",
1920
"Dscijava",
2021
"flatfield",

tests/test_misc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,18 @@ def getInputs(self):
8686
return self.inputs
8787

8888

89+
def test_save_script_parameters_fail(caplog):
90+
"""Tests save_script_parameters with an invalid script_globals object."""
91+
caplog.clear()
92+
93+
save_script_parameters(script_globals=None, destination="")
94+
assert "ScriptModule inspection failed" in caplog.messages[0]
95+
96+
8997
# FIXME: probably better use monkeypatch instead of mocker for more flexibility
9098
# in modifying the return value depending on the ScriptModule contents
9199
def test_save_script_parameters(tmpdir, mocker):
92-
"""Tests for imcflibs.imagej.misc.save_script_parameters."""
100+
"""Tests save_script_parameters."""
93101
base = tmpdir.mkdir("base")
94102
m_is_password_style = mocker.patch("imcflibs.imagej.misc._is_password_style")
95103
m_is_password_style.return_value = False

0 commit comments

Comments
 (0)