forked from openMetadataInitiative/bids2openminds
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating behavioral protocol (openMetadataInitiative#52)
* protocol * deling with no task * behavioral_protocol * adding test for behavioral_protocols * adding behavioral_protocol_number to test_bids_examples.py
- Loading branch information
Showing
4 changed files
with
63 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pytest | ||
from bids import BIDSLayout | ||
from openminds import Collection | ||
import os | ||
from bids2openminds.main import create_behavioral_protocol | ||
|
||
(datasets, tasks) = ("ds002", ("deterministicclassification", | ||
"mixedeventrelatedprobe", "probabilisticclassification")) | ||
|
||
|
||
@pytest.fixture | ||
def creating_behavioral_protocols(): | ||
c = Collection() | ||
test_dir = os.path.join("bids-examples", datasets) | ||
bids_layout = BIDSLayout(test_dir) | ||
_, behavioral_protocols_dict = create_behavioral_protocol( | ||
bids_layout, c) | ||
return behavioral_protocols_dict | ||
|
||
|
||
def test_behavioral_protocols(creating_behavioral_protocols): | ||
assert len(tasks) == len(creating_behavioral_protocols) | ||
for item in creating_behavioral_protocols: | ||
assert item in tasks | ||
assert creating_behavioral_protocols[item].internal_identifier == item |