@@ -148,31 +148,27 @@ def test_download_study(self):
148
148
response = self .get ('/download_study_bioms/1' )
149
149
self .assertEqual (response .code , 200 )
150
150
exp = (
151
- '- 1256812 /protected/processed_data/'
152
- '1_study_1001_closed_reference_otu_table .biom processed_data/'
153
- '1_study_1001_closed_reference_otu_table .biom\n '
154
- '- [0-9]* /protected/templates/1_prep_1_[0-9]*-[0-9]* .txt '
151
+ '- \\ d+ /protected/processed_data/1_study_1001_closed_reference_ '
152
+ 'otu_table .biom processed_data/1_study_1001_closed_reference_otu '
153
+ '_table .biom\n '
154
+ '- \\ d+ /protected/templates/1_prep_1_qiime_19700101-000000 .txt '
155
155
'mapping_files/4_mapping_file.txt\n '
156
- '- 1256812 /protected/processed_data/'
157
- '1_study_1001_closed_reference_otu_table .biom processed_data/'
158
- '1_study_1001_closed_reference_otu_table .biom\n '
159
- '- [0-9]* /protected/templates/1_prep_1_[0-9]*-[0-9]* .txt '
156
+ '- \\ d+ /protected/processed_data/1_study_1001_closed_reference_ '
157
+ 'otu_table .biom processed_data/1_study_1001_closed_reference_otu '
158
+ '_table .biom\n '
159
+ '- \\ d+ /protected/templates/1_prep_1_qiime_19700101-000000 .txt '
160
160
'mapping_files/5_mapping_file.txt\n '
161
- '- 1256812 /protected/processed_data/1_study_1001_ '
162
- 'closed_reference_otu_table_Silva .biom processed_data/'
163
- '1_study_1001_closed_reference_otu_table_Silva .biom\n '
164
- '- [0-9]* /protected/templates/1_prep_1_[0-9]*-[0-9]* .txt '
161
+ '- \\ d+ /protected/processed_data/1_study_1001_closed_reference_ '
162
+ 'otu_table_Silva .biom processed_data/1_study_1001_closed_ '
163
+ 'reference_otu_table_Silva .biom\n '
164
+ '- \\ d+ /protected/templates/1_prep_1_qiime_19700101-000000 .txt '
165
165
'mapping_files/6_mapping_file.txt\n '
166
- '- 1093210 /protected/BIOM/7/biom_table.biom '
167
- 'BIOM/7/biom_table.biom\n '
168
- '- [0-9]* /protected/templates/1_prep_2_[0-9]*-[0-9]*.txt '
169
- 'mapping_files/7_mapping_file.txt\n '
170
- '- [0-9]* /protected/BIOM/{0}/otu_table.biom '
171
- 'BIOM/{0}/otu_table.biom\n '
172
- '- 1 /protected/BIOM/10/sortmerna_picked_otus/seqs_otus.log '
173
- 'BIOM/{0}/sortmerna_picked_otus/seqs_otus.log\n '
174
- '- [0-9]* /protected/templates/1_prep_1_[0-9]*-[0-9]*.txt '
175
- 'mapping_files/{0}_mapping_file.txt\n ' .format (a .id ))
166
+ '- \\ d+ /protected/BIOM/7/biom_table.biom BIOM/7/biom_table.biom\n '
167
+ '- \\ d+ /protected/BIOM/10/otu_table.biom BIOM/10/otu_table.biom\n '
168
+ '- \\ d+ /protected/BIOM/10/sortmerna_picked_otus/seqs_otus.log '
169
+ 'BIOM/10/sortmerna_picked_otus/seqs_otus.log\n '
170
+ '- \\ d+ /protected/templates/1_prep_1_qiime_19700101-000000.txt '
171
+ 'mapping_files/10_mapping_file.txt\n ' )
176
172
self .assertRegex (response .body .decode ('ascii' ), exp )
177
173
178
174
response = self .get ('/download_study_bioms/200' )
@@ -190,10 +186,9 @@ def test_download_study(self):
190
186
a .visibility = 'private'
191
187
self .assertEqual (response .code , 200 )
192
188
# we should have the same files than the previous test, except artifact
193
- # and mapping file 7: position 6 and 7 ; thus removing 6 twice
189
+ # and mapping file 7: position 6; thus removing 6
194
190
exp = exp .split ('\n ' )
195
191
exp .pop (6 )
196
- exp .pop (6 )
197
192
exp = '\n ' .join (exp )
198
193
self .assertRegex (response .body .decode ('ascii' ), exp )
199
194
@@ -244,7 +239,7 @@ def test_download_raw_data(self):
244
239
'- 58 /protected/raw_data/'
245
240
'1_s_G1_L001_sequences_barcodes.fastq.gz '
246
241
'raw_data/1_s_G1_L001_sequences_barcodes.fastq.gz\n '
247
- '- [0-9]* /protected/templates/1_prep_1_ [0-9]*-[0-9]*.txt '
242
+ '- [0-9]* /protected/templates/1_prep_1_qiime_ [0-9]*-[0-9]*.txt '
248
243
'mapping_files/1_mapping_file.txt\n '
249
244
'- 1093210 /protected/BIOM/7/biom_table.biom '
250
245
'BIOM/7/biom_table.biom\n ' )
@@ -273,8 +268,8 @@ def test_download_raw_data(self):
273
268
return_value = User (
"[email protected] " ))
274
269
response = self .get ('/download_study_bioms/1' )
275
270
self .assertEqual (response .code , 200 )
276
- exp = ('- [0-9]* /protected/templates/1_prep_2_[0-9]*-[0-9]*.txt '
277
- 'mapping_files/7_mapping_file.txt \n ' )
271
+ exp = ('- [0-9]* /protected/BIOM/7/biom_table.biom '
272
+ 'BIOM/7/biom_table.biom \n ' )
278
273
self .assertRegex (response .body .decode ('ascii' ), exp )
279
274
280
275
@@ -405,17 +400,16 @@ def test_download(self):
405
400
# check success
406
401
response = self .get ('/public_download/?data=biom&study_id=1' )
407
402
self .assertEqual (response .code , 200 )
408
- exp = ('- [0-9]* /protected/templates/1_prep_2_[0-9]*-[0-9]*.txt '
409
- 'mapping_files/7_mapping_file.txt \n ' )
403
+ exp = ('- [0-9]* /protected/BIOM/7/biom_table.biom '
404
+ ' BIOM/7/biom_table.biom \n ' )
410
405
self .assertRegex (response .body .decode ('ascii' ), exp )
411
406
412
407
Study (1 ).public_raw_download = True
413
408
# check success
414
409
response = self .get ('/public_download/?data=raw&study_id=1' )
415
410
self .assertEqual (response .code , 200 )
416
- exp = (
417
- '- [0-9]* /protected/templates/1_prep_2_[0-9]*-[0-9]*.txt '
418
- 'mapping_files/7_mapping_file.txt\n ' )
411
+ exp = ('- [0-9]* /protected/BIOM/7/biom_table.biom'
412
+ ' BIOM/7/biom_table.biom\n ' )
419
413
self .assertRegex (response .body .decode ('ascii' ), exp )
420
414
421
415
# testing data_type
@@ -447,7 +441,7 @@ def test_download(self):
447
441
exp = (
448
442
'[0-9]* [0-9]* /protected/raw_data/1_s_G1_L001_sequences_barcodes'
449
443
'.fastq.gz raw_data/1_s_G1_L001_sequences_barcodes.fastq.gz\n '
450
- '- [0-9]* /protected/templates/1_prep_1_[0-9]*-[0-9]* .txt '
444
+ '- [0-9]* /protected/templates/1_prep_1_qiime_19700101-000000 .txt '
451
445
'mapping_files/1_mapping_file.txt' )
452
446
self .assertRegex (response .body .decode ('ascii' ), exp )
453
447
@@ -458,11 +452,12 @@ def test_download(self):
458
452
'- [0-9]* /protected/processed_data/1_study_1001_closed_'
459
453
'reference_otu_table.biom processed_data/1_study_1001_closed_'
460
454
'reference_otu_table.biom\n - [0-9]* /protected/templates/1_prep_'
461
- '1_[0-9]*-[0-9]* .txt mapping_files/4_mapping_file.txt\n '
455
+ '1_qiime_19700101-000000 .txt mapping_files/4_mapping_file.txt\n '
462
456
'- [0-9]* /protected/processed_data/1_study_1001_closed_'
463
457
'reference_otu_table.biom processed_data/1_study_1001_closed_'
464
- 'reference_otu_table.biom\n - [0-9]* /protected/templates/1_prep_1'
465
- '_[0-9]*-[0-9]*.txt mapping_files/5_mapping_file.txt\n ' )
458
+ 'reference_otu_table.biom\n - [0-9]* /protected/templates/1_prep_'
459
+ '1_qiime_19700101-000000.txt mapping_files/5_mapping_file.txt\n ' )
460
+
466
461
self .assertRegex (response .body .decode ('ascii' ), exp )
467
462
468
463
def test_download_sample_information (self ):
@@ -506,8 +501,8 @@ def test_download_sample_information(self):
506
501
response = self .get (
507
502
'/public_download/?data=prep_information&prep_id=1' )
508
503
self .assertEqual (response .code , 200 )
509
- exp = ('[0-9]* [0-9]* /protected/templates/1_prep_1_ [0-9]*-[0-9]'
510
- '*.txt templates/1_prep_1_ [0-9]*-[0-9]*.txt\n ' )
504
+ exp = ('- [0-9]* /protected/templates/1_prep_1_qiime_ [0-9]*-[0-9]'
505
+ '*.txt templates/1_prep_1_qiime_ [0-9]*-[0-9]*.txt\n ' )
511
506
self .assertRegex (response .body .decode ('ascii' ), exp )
512
507
513
508
@@ -536,7 +531,7 @@ def test_download(self):
536
531
'- [0-9]* /protected/processed_data/'
537
532
'1_study_1001_closed_reference_otu_table.biom '
538
533
'processed_data/1_study_1001_closed_reference_otu_table.biom\n '
539
- '- [0-9]* /protected/templates/1_prep_1_[0-9]*-[0-9]* .txt '
534
+ '- [0-9]* /protected/templates/1_prep_1_qiime_19700101-000000 .txt '
540
535
'mapping_files/5_mapping_file.txt' )
541
536
self .assertRegex (response .body .decode ('ascii' ), exp )
542
537
@@ -557,13 +552,12 @@ def test_download(self):
557
552
o = urlparse (resp_dict ["url" ])
558
553
response_file = self .get (o .path )
559
554
self .assertEqual (response_file .code , 200 )
560
-
561
555
exp = (
562
556
'- 58 /protected/raw_data/1_s_G1_L001_sequences.fastq.gz '
563
557
'raw_data/1_s_G1_L001_sequences.fastq.gz\n '
564
558
'- 58 /protected/raw_data/1_s_G1_L001_sequences_barcodes.'
565
559
'fastq.gz raw_data/1_s_G1_L001_sequences_barcodes.fastq.gz\n '
566
- '- [0-9]* /protected/templates/1_prep_1_[0-9]*-[0-9]* .txt '
560
+ '- [0-9]* /protected/templates/1_prep_1_qiime_19700101-000000 .txt '
567
561
'mapping_files/1_mapping_file.txt\n '
568
562
)
569
563
self .assertRegex (response_file .body .decode ('ascii' ), exp )
0 commit comments