Skip to content

Commit 3af4bd8

Browse files
committed
test that file is not overwritten without --force
1 parent a536ed3 commit 3af4bd8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nibabel/cmdline/tests/test_conform.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ def test_default(tmpdir):
3232
assert c.header.get_zooms() == (1, 1, 1)
3333
assert nib.orientations.aff2axcodes(c.affine) == ('R', 'A', 'S')
3434

35+
with pytest.raises(FileExistsError):
36+
main([str(infile), str(outfile)])
37+
38+
main([str(infile), str(outfile), "--force"])
39+
assert outfile.isfile()
40+
3541

3642
@needs_scipy
3743
def test_nondefault(tmpdir):

0 commit comments

Comments
 (0)