Skip to content

Commit 0e281e4

Browse files
committed
fixing some errors
1 parent ff57d44 commit 0e281e4

File tree

1 file changed

+28
-44
lines changed

1 file changed

+28
-44
lines changed

qiita_pet/test/test_download.py

Lines changed: 28 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -147,44 +147,29 @@ def test_download_study(self):
147147

148148
response = self.get('/download_study_bioms/1')
149149
self.assertEqual(response.code, 200)
150-
151150
exp = (
152-
'\- \d+ /protected/processed_data/'
153-
'1_study_1001_closed_reference_otu_table.biom processed_data/'
154-
'1_study_1001_closed_reference_otu_table.biom\n'
155-
'\- \d+ /protected/templates/'
156-
'1_prep_1_\d\d\d\d\d\d\d\d-\d\d\d\d\d\d.txt '
157-
'mapping_files/\d_mapping_file.txt\n'
158-
'\- \d+ /protected/processed_data/'
159-
'1_study_1001_closed_reference_otu_table.biom '
160-
'processed_data/1_study_1001_closed_reference_otu_table.biom\n'
161-
'\- \d+ /protected/templates/'
162-
'1_prep_1_\d\d\d\d\d\d\d\d-\d\d\d\d\d\d.txt mapping_files/'
163-
'\d_mapping_file.txt\n'
164-
'\- \d+ /protected/processed_data/'
165-
'1_study_1001_closed_reference_otu_table_Silva.biom '
166-
'processed_data/'
167-
'1_study_1001_closed_reference_otu_table_Silva.biom\n'
168-
'\- \d+ /protected/templates/'
169-
'1_prep_1_\d\d\d\d\d\d\d\d-\d\d\d\d\d\d.txt '
170-
'mapping_files/6_mapping_file.txt\n'
171-
'\- \d+ /protected/BIOM/7/biom_table.biom BIOM/7/'
172-
'biom_table.biom\n'
173-
'\- \d+ /protected/templates/'
174-
'1_prep_2_\d\d\d\d\d\d\d\d-\d\d\d\d\d\d.txt '
175-
'mapping_files/7_mapping_file.txt\n'
176-
'\- \d+ /protected/BIOM/10/otu_table.biom '
177-
'BIOM/10/otu_table.biom\n'
178-
'\- \d+ /protected/BIOM/10/sortmerna_picked_otus/seqs_otus.log '
179-
'BIOM/10/sortmerna_picked_otus/seqs_otus.log\n'
180-
'\- \d+ /protected/templates/'
181-
'1_prep_1_\d\d\d\d\d\d\d\d-\d\d\d\d\d\d.txt '
182-
'mapping_files/10_mapping_file.txt\n'
183-
)
184-
185-
obs = response.body.decode('ascii')
186-
187-
self.assertRegex(obs, exp)
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+
'mapping_files/4_mapping_file.txt\n'
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+
'mapping_files/5_mapping_file.txt\n'
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+
'mapping_files/6_mapping_file.txt\n'
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')
172+
self.assertRegex(response.body.decode('ascii'), exp)
188173

189174
response = self.get('/download_study_bioms/200')
190175
self.assertEqual(response.code, 405)
@@ -201,10 +186,9 @@ def test_download_study(self):
201186
a.visibility = 'private'
202187
self.assertEqual(response.code, 200)
203188
# we should have the same files than the previous test, except artifact
204-
# and mapping file 7: position 6 and 7; thus removing 6 twice
189+
# and mapping file 7: position 6; thus removing 6
205190
exp = exp.split('\n')
206191
exp.pop(6)
207-
exp.pop(6)
208192
exp = '\n'.join(exp)
209193
self.assertRegex(response.body.decode('ascii'), exp)
210194

@@ -255,7 +239,7 @@ def test_download_raw_data(self):
255239
'- 58 /protected/raw_data/'
256240
'1_s_G1_L001_sequences_barcodes.fastq.gz '
257241
'raw_data/1_s_G1_L001_sequences_barcodes.fastq.gz\n'
258-
'- [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 '
259243
'mapping_files/1_mapping_file.txt\n'
260244
'- 1093210 /protected/BIOM/7/biom_table.biom '
261245
'BIOM/7/biom_table.biom\n')
@@ -284,8 +268,8 @@ def test_download_raw_data(self):
284268
return_value=User("[email protected]"))
285269
response = self.get('/download_study_bioms/1')
286270
self.assertEqual(response.code, 200)
287-
exp = ('- [0-9]* /protected/templates/1_prep_2_[0-9]*-[0-9]*.txt '
288-
'mapping_files/7_mapping_file.txt\n')
271+
exp = ('- [0-9]* /protected/BIOM/7/biom_table.biom '
272+
'BIOM/7/biom_table.biom\n')
289273
self.assertRegex(response.body.decode('ascii'), exp)
290274

291275

@@ -517,8 +501,8 @@ def test_download_sample_information(self):
517501
response = self.get(
518502
'/public_download/?data=prep_information&prep_id=1')
519503
self.assertEqual(response.code, 200)
520-
exp = ('[0-9]* [0-9]* /protected/templates/1_prep_1_[0-9]*-[0-9]'
521-
'*.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')
522506
self.assertRegex(response.body.decode('ascii'), exp)
523507

524508

0 commit comments

Comments
 (0)