Skip to content

Commit

Permalink
TST: test feature metadata mismatch error :) biocore#130
Browse files Browse the repository at this point in the history
  • Loading branch information
fedarko committed May 25, 2020
1 parent b2a843a commit d111164
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/python/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,19 @@ def test_match_inputs_feature_metadata_nothing_dropped(self):
f_feature_metadata, self.feature_metadata, check_like=True
)

def test_match_inputs_feature_metadata_no_features_in_tree(self):
t = Tree.from_tree(self.tree)
bad_fm = self.feature_metadata.copy()
bad_fm.index = range(len(self.feature_metadata.index))
with self.assertRaisesRegex(
tools.DataMatchingError,
(
"No features in the feature metadata are present in the tree, "
"either as tips or as internal nodes."
)
):
tools.match_inputs(t, self.table, self.sample_metadata, bad_fm)


if __name__ == "__main__":
unittest.main()

0 comments on commit d111164

Please sign in to comment.