Skip to content

Commit 6449809

Browse files
committed
Adding tests
1 parent fa27255 commit 6449809

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

qiita_db/test/test_commands.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,18 @@ def tearDown(self):
7474
remove(fp)
7575
for dp in self.dirs_to_remove:
7676
if exists(dp):
77-
remove(dp)
77+
rmtree(dp)
7878

7979
def test_import_preprocessed_data(self):
80-
81-
import_preprocessed_data(1, self.tmpdir, 1,
82-
'preprocessed_sequence_illumina_params',
83-
1, False)
84-
sql = ("select preprocessed_data_id from qitta.preprocessed_data"
85-
"where study_id = %s and preprocessed_params_table = %s")
86-
ppd_ids = self.conn_handler.execute_fetchall(
87-
sql, ('1', 'preprocessed_sequence_illumina_params'))
88-
self.assertEqual(len(ppd_ids), 2)
80+
initial_ppd_count = get_count('qiita.preprocessed_data')
81+
initial_fp_count = get_count('qiita.filepath')
82+
ppd = import_preprocessed_data(1, self.tmpdir, 1,
83+
'preprocessed_sequence_illumina_params',
84+
1, False)
85+
self.assertEqual(ppd.id, 3)
86+
self.assertTrue(check_count('qiita.preprocessed_data',
87+
initial_ppd_count + 1))
88+
self.assertTrue(check_count('qiita.filepath', initial_fp_count+2))
8989

9090

9191
@qiita_test_checker()

0 commit comments

Comments
 (0)