File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -156,12 +156,12 @@ def add_to_datalad(
156
156
157
157
# Provide metadata for sensitive information
158
158
sensitive_patterns = [
159
- "sourcedata" ,
159
+ "sourcedata/** " ,
160
160
"*_scans.tsv" , # top level
161
161
"*/*_scans.tsv" , # within subj
162
162
"*/*/*_scans.tsv" , # within sess/subj
163
- "*/anat" , # within subj
164
- "*/*/anat" , # within ses/subj
163
+ "*/anat/* " , # within subj
164
+ "*/*/anat/* " , # within ses/subj
165
165
]
166
166
for sp in sensitive_patterns :
167
167
mark_sensitive (ds , sp , annexed_files )
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ def test_conversion(
55
55
heuristic ,
56
56
anon_cmd ,
57
57
template = "sourcedata/sub-{subject}/*/*/*.tgz" ,
58
+ xargs = ["--datalad" ],
58
59
)
59
60
runner (args ) # run conversion
60
61
@@ -96,6 +97,18 @@ def test_conversion(
96
97
for key in keys :
97
98
assert orig [key ] == conv [key ]
98
99
100
+ # validate sensitive marking
101
+ from datalad .api import Dataset
102
+
103
+ ds = Dataset (outdir )
104
+ all_meta = dict (ds .repo .get_metadata ("." ))
105
+ target_rec = {"distribution-restrictions" : ["sensitive" ]}
106
+ for pth , meta in all_meta .items ():
107
+ if "anat" in pth or "scans.tsv" in pth :
108
+ assert meta == target_rec
109
+ else :
110
+ assert meta == {}
111
+
99
112
100
113
@pytest .mark .skipif (not have_datalad , reason = "no datalad" )
101
114
def test_multiecho (
You can’t perform that action at this time.
0 commit comments