Skip to content

Commit

Permalink
directories in test
Browse files Browse the repository at this point in the history
  • Loading branch information
squirrelo committed May 4, 2016
1 parent 1e6aa1e commit 1eb39c8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_per_category.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from os import makedirs, listdir, rmdir
from os.path import exists, join
from os import makedirs, listdir
from os.path import join, dirname, realpath
from shutil import rmtree

from unittest import TestCase, main
Expand All @@ -11,7 +11,9 @@
class PerCategoryTests(TestCase):
def setUp(self):
# Make expected directory structure
makedirs('../agp_processing/10-populated-templates/taxa')
currpath = dirname(realpath(__file__))
self.dirpath = join(currpath, '../agp_processing/10-populated-templates/taxa')
makedirs(self.dirpath)
self.path = agenv.paths['collapsed']['notrim']['1k']
agenv.paths['collapsed']['notrim']['1k'] = \
{'ag-biom':
Expand All @@ -22,7 +24,7 @@ def setUp(self):
'../tests/data/ag_testing/ag-oral-flossing.biom'}

def tearDown(self):
rmtree('../agp_processing', ignore_errors=True)
rmtree(self.dirpath, ignore_errors=True)
agenv.paths['collapsed']['notrim']['1k'] = self.path

def test_cat_taxa_summaries(self):
Expand All @@ -34,7 +36,7 @@ def test_cat_taxa_summaries(self):
'ag-oral-flossing-Rarely.txt', 'ag-oral-flossing-Regularly.txt',
'ag-stool-average.txt']
files = listdir(path)
self.assertEqual(files, exp)
self.assertItemsEqual(files, exp)

with open(join(path, 'ag-oral-flossing-Rarely.txt')) as f:
obs = f.read()
Expand Down

0 comments on commit 1eb39c8

Please sign in to comment.