Skip to content

Commit 83b887e

Browse files
committed
TST: Move private variable testing to unittest
1 parent 343cdb3 commit 83b887e

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

niworkflows/interfaces/bids.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,18 +253,11 @@ class BIDSDataGrabber(SimpleInterface):
253253
>>> bids_src.inputs.subject_data = bids_collect_data(
254254
... str(datadir / 'ds114'), '01', bids_validate=False)[0]
255255
>>> bids_src.inputs.subject_id = '01'
256-
>>> bids_src._require_t1w
257-
True
258-
>>> bids_src._require_funcs
259-
True
260256
>>> res = bids_src.run()
261257
>>> res.outputs.t1w # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
262258
['.../ds114/sub-01/ses-retest/anat/sub-01_ses-retest_T1w.nii.gz',
263259
'.../ds114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz']
264260
265-
>>> bids_src = BIDSDataGrabber(require_t1w=False)
266-
>>> bids_src._require_t1w
267-
False
268261
"""
269262

270263
input_spec = _BIDSDataGrabberInputSpec

niworkflows/interfaces/tests/test_bids.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,3 +793,16 @@ def test_fsdir_min_version(tmp_path, min_version):
793793
assert not patched_subject_dir.exists()
794794
else:
795795
assert patched_subject_dir.exists()
796+
797+
798+
def test_BIDSDataGrabber():
799+
x = bintfs.BIDSDataGrabber(anat_only=True)
800+
assert x._require_t1w is True
801+
assert x._require_funcs is False
802+
803+
x = bintfs.BIDSDataGrabber(anat_only=False, require_t1w=False)
804+
assert x._require_t1w is False
805+
assert x._require_funcs is True
806+
807+
x = bintfs.BIDSDataGrabber(anat_derivatives='derivatives')
808+
assert x._require_t1w is False

0 commit comments

Comments
 (0)