@@ -51,6 +51,26 @@ def test_selectfiles():
51
51
yield assert_equal , res .outputs .converter , wanted
52
52
53
53
54
+ def test_datagrabber_order ():
55
+ tempdir = mkdtemp ()
56
+ file1 = mkstemp (prefix = 'sub002_L1_R1.q' , dir = tempdir )
57
+ file2 = mkstemp (prefix = 'sub002_L1_R2.q' , dir = tempdir )
58
+ file3 = mkstemp (prefix = 'sub002_L2_R1.q' , dir = tempdir )
59
+ file4 = mkstemp (prefix = 'sub002_L2_R2.q' , dir = tempdir )
60
+ dg = nio .DataGrabber (infields = ['sid' ])
61
+ dg .inputs .base_directory = tempdir
62
+ dg .inputs .template = '%s_L%d_R?.q*'
63
+ dg .inputs .template_args = {'outfiles' : [['sid' , 1 ], ['sid' , 2 ]]}
64
+ dg .inputs .sid = 'sub002'
65
+ dg .inputs .sort_filelist = True
66
+ res = dg .run ()
67
+ outfiles = res .outputs .outfiles
68
+ yield assert_true , 'sub002_L1_R1' in outfiles [0 ][0 ]
69
+ yield assert_true , 'sub002_L1_R2' in outfiles [0 ][1 ]
70
+ yield assert_true , 'sub002_L2_R1' in outfiles [1 ][0 ]
71
+ yield assert_true , 'sub002_L2_R2' in outfiles [1 ][1 ]
72
+ shutil .rmtree (tempdir )
73
+
54
74
def test_datasink ():
55
75
ds = nio .DataSink ()
56
76
yield assert_true , ds .inputs .parameterization
0 commit comments