Skip to content

Commit

Permalink
[ADD] first test for spm parser
Browse files Browse the repository at this point in the history
  • Loading branch information
remiadon committed Feb 8, 2021
1 parent 4518748 commit 20eb527
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ settings.json
**/*.gz
.datalad
**/*.tsv
*.png
*.json
**/*.pyc

*.DS_Store
*.ipynb_checkpoints
Expand Down
Empty file added bids_prov/tests/__init__.py
Empty file.
28 changes: 28 additions & 0 deletions bids_prov/tests/test_spm_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import pytest
import json

from ..spm_parser import get_records


def test_get_records_copy_attributes():
task_groups = dict(
file_ops_1=[
".files = {'$PATH-TO-NII-FILES/tonecounting_bold.nii.gz'};",
".action.copyto = {'$PATH-TO-PREPROCESSING/FUNCTIONAL'};",
]
)
recs = get_records(task_groups)
attrs = [_["attributes"] for _ in recs["prov:Activity"]]
assert "action.copyto" in json.dumps(attrs)


def test_get_records_attrs():
task_groups = dict(
estwrite_5=[
".sep = 4;",
".fwhm = 5;",
]
)
recs = get_records(task_groups)
attrs = [_["attributes"] for _ in recs["prov:Activity"]]
assert "4" in json.dumps(attrs)

0 comments on commit 20eb527

Please sign in to comment.