@@ -148,31 +148,27 @@ def test_download_study(self):
148148 response = self .get ('/download_study_bioms/1' )
149149 self .assertEqual (response .code , 200 )
150150 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 '
155155 '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 '
160160 '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 '
165165 '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 ' )
176172 self .assertRegex (response .body .decode ('ascii' ), exp )
177173
178174 response = self .get ('/download_study_bioms/200' )
@@ -190,10 +186,9 @@ def test_download_study(self):
190186 a .visibility = 'private'
191187 self .assertEqual (response .code , 200 )
192188 # 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
194190 exp = exp .split ('\n ' )
195191 exp .pop (6 )
196- exp .pop (6 )
197192 exp = '\n ' .join (exp )
198193 self .assertRegex (response .body .decode ('ascii' ), exp )
199194
@@ -244,7 +239,7 @@ def test_download_raw_data(self):
244239 '- 58 /protected/raw_data/'
245240 '1_s_G1_L001_sequences_barcodes.fastq.gz '
246241 '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 '
248243 'mapping_files/1_mapping_file.txt\n '
249244 '- 1093210 /protected/BIOM/7/biom_table.biom '
250245 'BIOM/7/biom_table.biom\n ' )
@@ -273,8 +268,8 @@ def test_download_raw_data(self):
273268 return_value = User ("demo@microbio.me" ))
274269 response = self .get ('/download_study_bioms/1' )
275270 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 ' )
278273 self .assertRegex (response .body .decode ('ascii' ), exp )
279274
280275
@@ -405,17 +400,16 @@ def test_download(self):
405400 # check success
406401 response = self .get ('/public_download/?data=biom&study_id=1' )
407402 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 ' )
410405 self .assertRegex (response .body .decode ('ascii' ), exp )
411406
412407 Study (1 ).public_raw_download = True
413408 # check success
414409 response = self .get ('/public_download/?data=raw&study_id=1' )
415410 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 ' )
419413 self .assertRegex (response .body .decode ('ascii' ), exp )
420414
421415 # testing data_type
@@ -447,7 +441,7 @@ def test_download(self):
447441 exp = (
448442 '[0-9]* [0-9]* /protected/raw_data/1_s_G1_L001_sequences_barcodes'
449443 '.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 '
451445 'mapping_files/1_mapping_file.txt' )
452446 self .assertRegex (response .body .decode ('ascii' ), exp )
453447
@@ -458,11 +452,12 @@ def test_download(self):
458452 '- [0-9]* /protected/processed_data/1_study_1001_closed_'
459453 'reference_otu_table.biom processed_data/1_study_1001_closed_'
460454 '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 '
462456 '- [0-9]* /protected/processed_data/1_study_1001_closed_'
463457 '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+
466461 self .assertRegex (response .body .decode ('ascii' ), exp )
467462
468463 def test_download_sample_information (self ):
@@ -506,8 +501,8 @@ def test_download_sample_information(self):
506501 response = self .get (
507502 '/public_download/?data=prep_information&prep_id=1' )
508503 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 ' )
511506 self .assertRegex (response .body .decode ('ascii' ), exp )
512507
513508
@@ -536,7 +531,7 @@ def test_download(self):
536531 '- [0-9]* /protected/processed_data/'
537532 '1_study_1001_closed_reference_otu_table.biom '
538533 '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 '
540535 'mapping_files/5_mapping_file.txt' )
541536 self .assertRegex (response .body .decode ('ascii' ), exp )
542537
@@ -557,13 +552,12 @@ def test_download(self):
557552 o = urlparse (resp_dict ["url" ])
558553 response_file = self .get (o .path )
559554 self .assertEqual (response_file .code , 200 )
560-
561555 exp = (
562556 '- 58 /protected/raw_data/1_s_G1_L001_sequences.fastq.gz '
563557 'raw_data/1_s_G1_L001_sequences.fastq.gz\n '
564558 '- 58 /protected/raw_data/1_s_G1_L001_sequences_barcodes.'
565559 '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 '
567561 'mapping_files/1_mapping_file.txt\n '
568562 )
569563 self .assertRegex (response_file .body .decode ('ascii' ), exp )
0 commit comments