Skip to content

Commit 563dc68

Browse files
author
Adam Robbins-Pianka
committed
Add second biom table to test
1 parent a682de3 commit 563dc68

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

qiita_db/test/test_commands.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,17 @@ class TestLoadProcessedDataFromCmd(TestCase):
154154
def setUp(self):
155155
fd, self.otu_table_fp = mkstemp(suffix='_otu_table.biom')
156156
close(fd)
157+
fd, self.otu_table_2_fp = mkstemp(suffix='_otu_table2.biom')
158+
close(fd)
157159

158160
with open(self.otu_table_fp, "w") as f:
159161
f.write("\n")
162+
with open(self.otu_table_2_fp, "w") as f:
163+
f.write("\n")
160164

161165
self.files_to_remove = []
162166
self.files_to_remove.append(self.otu_table_fp)
167+
self.files_to_remove.append(self.otu_table_2_fp)
163168

164169
self.db_test_processed_data_dir = join(get_db_files_base_dir(),
165170
'processed_data')
@@ -170,8 +175,8 @@ def tearDown(self):
170175
remove(fp)
171176

172177
def test_load_processed_data_from_cmd(self):
173-
filepaths = [self.otu_table_fp]
174-
filepath_types = ['biom']
178+
filepaths = [self.otu_table_fp, self.otu_table_2_fp]
179+
filepath_types = ['biom', 'biom']
175180

176181
initial_processed_data_count = get_count('qiita.processed_data')
177182
initial_processed_fp_count = get_count('qiita.processed_filepath')
@@ -183,19 +188,23 @@ def test_load_processed_data_from_cmd(self):
183188
self.files_to_remove.append(
184189
join(self.db_test_processed_data_dir,
185190
'%d_%s' % (processed_data_id, basename(self.otu_table_fp))))
191+
self.files_to_remove.append(
192+
join(self.db_test_processed_data_dir,
193+
'%d_%s' % (processed_data_id,
194+
basename(self.otu_table_2_fp))))
186195

187196
self.assertTrue(check_count('qiita.processed_data',
188197
initial_processed_data_count + 1))
189198
self.assertTrue(check_count('qiita.processed_filepath',
190-
initial_processed_fp_count + 1))
199+
initial_processed_fp_count + 2))
191200
self.assertTrue(check_count('qiita.filepath',
192-
initial_fp_count + 1))
201+
initial_fp_count + 2))
193202

194203
# Ensure that the ValueError is raised when a filepath_type is not
195204
# provided for each and every filepath
196205
with self.assertRaises(ValueError):
197-
load_processed_data_cmd(filepaths, [], 'processed_params_uclust',
198-
1, 1, None)
206+
load_processed_data_cmd(filepaths, filepath_types[:-1],
207+
'processed_params_uclust', 1, 1, None)
199208

200209

201210
CONFIG_1 = """[required]

0 commit comments

Comments
 (0)