Commit 25afaeba authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: test bad json

parent b6cf8d8c
......@@ -1414,11 +1414,23 @@ def test_loadMeta_nonBids():
with open(op.join('data', 'dataset_description.json'), 'wt') as f:
pass
img = fslimage.Image(imgfile, loadMeta=True)
assert list(img.metaKeys()) == []
def test_loadMeta_badJSON():
with tempdir():
make_image('image.nii.gz')
# spurious comma after b:2
with open('image.json', 'wt') as f:
f.write('{"a" : 1, "b" : 2,}')
# bad json should not cause failure
img = fslimage.Image('image.nii.gz', loadMeta=True)
assert list(img.metaKeys()) == []
def test_loadMetadata():
with tempdir():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment