Skip to content

Commit 40ea6a5

Browse files
committed
Cleaning up environment
1 parent 6449809 commit 40ea6a5

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

qiita_db/test/test_commands.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,20 @@ def test_make_study_from_cmd(self):
5454
class TestImportPreprocessedData(TestCase):
5555
def setUp(self):
5656
self.tmpdir = mkdtemp()
57-
fd, file1 = mkstemp(dir=self.tmpdir)
57+
fd, self.file1 = mkstemp(dir=self.tmpdir)
5858
close(fd)
59-
fd, file2 = mkstemp(dir=self.tmpdir)
59+
fd, self.file2 = mkstemp(dir=self.tmpdir)
6060
close(fd)
61-
with open(file1, "w") as f:
61+
with open(self.file1, "w") as f:
6262
f.write("\n")
63-
with open(file2, "w") as f:
63+
with open(self.file2, "w") as f:
6464
f.write("\n")
6565

66-
self.files_to_remove = [file1, file2]
66+
self.files_to_remove = [self.file1, self.file2]
6767
self.dirs_to_remove = [self.tmpdir]
6868

69-
self.db_test_raw_dir = join(get_db_files_base_dir(), 'raw_data')
69+
self.db_test_ppd_dir = join(get_db_files_base_dir(),
70+
'preprocessed_data')
7071

7172
def tearDown(self):
7273
for fp in self.files_to_remove:
@@ -82,6 +83,12 @@ def test_import_preprocessed_data(self):
8283
ppd = import_preprocessed_data(1, self.tmpdir, 1,
8384
'preprocessed_sequence_illumina_params',
8485
1, False)
86+
self.files_to_remove.append(
87+
join(self.db_test_ppd_dir,
88+
'%d_%s' % (ppd.id, basename(self.file1))))
89+
self.files_to_remove.append(
90+
join(self.db_test_ppd_dir,
91+
'%d_%s' % (ppd.id, basename(self.file2))))
8592
self.assertEqual(ppd.id, 3)
8693
self.assertTrue(check_count('qiita.preprocessed_data',
8794
initial_ppd_count + 1))

0 commit comments

Comments
 (0)