Skip to content

Commit

Permalink
TST: fixes failing test (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcaporaso committed Mar 24, 2020
1 parent fa1a372 commit 8c6705f
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions q2_shogun/tests/test_shogun.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,27 @@ def _load(fp):
self.query = _load('query.qza')
self.refseqs = _load('refseqs.qza')
self.taxonomy = _load('taxonomy.qza')
self.taxatable = _load('taxatable.qza').view(biom.Table)

# def test_minipipe(self):
# taxa, kegg, modules, pathways = shogun.actions.minipipe(
# query=self.query, reference_reads=self.refseqs,
# reference_taxonomy=self.taxonomy, database=self.database)
self.taxatable = _load('taxatable.qza')

def test_nobunaga(self):
taxa = shogun.actions.nobunaga(
query=self.query, reference_reads=self.refseqs,
reference_taxonomy=self.taxonomy, database=self.database)
taxa_table = taxa.taxa_table.view(biom.Table).sort()
report = taxa_table.descriptive_equality(self.taxatable)
observed_taxa_table = taxa.taxa_table.view(biom.Table).\
sort(axis='observation').sort(axis='sample')

expected_taxa_table = self.taxatable.view(biom.Table).\
sort(axis='observation').sort(axis='sample')

observed_feature_ids = set(observed_taxa_table.ids(axis='observation'))
expected_feature_ids = set(expected_taxa_table.ids(axis='observation'))
self.assertEqual(observed_feature_ids, expected_feature_ids)

observed_sample_ids = set(observed_taxa_table.ids(axis='sample'))
expected_sample_ids = set(expected_taxa_table.ids(axis='sample'))
self.assertEqual(observed_sample_ids, expected_sample_ids)

report = observed_taxa_table.descriptive_equality(expected_taxa_table)
self.assertIn('Tables appear equal', report, report)


Expand Down

0 comments on commit 8c6705f

Please sign in to comment.