Skip to content

Commit d706d59

Browse files
committed
ENH(TST): verify that exception is raised when no heuristic specified
1 parent 347bcf6 commit d706d59

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

heudiconv/tests/test_main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ def test_populate_bids_templates(tmpdir):
6565

6666
# it should also be available as a command
6767
os.unlink(str(description_file))
68+
69+
# it must fail if no heuristic was provided
70+
with pytest.raises(ValueError) as cme:
71+
runner([
72+
'--command', 'populate-templates',
73+
'--files', str(tmpdir)
74+
])
75+
assert str(cme.value).startswith("Specify heuristic using -f. Known are:")
76+
assert "convertall," in str(cme.value)
77+
assert not description_file.exists()
78+
6879
runner([
6980
'--command', 'populate-templates', '-f', 'convertall',
7081
'--files', str(tmpdir)

0 commit comments

Comments
 (0)