def test_gene_ontologies_fail(self): fail_ontology = {'GO:0004871': 'signal transducer activity'} fail_pfam = 15 sample_ontology = pfam2go.GeneOntology('GO:0004871', 'signal transducer activity') sample_pfam = 'PF00015' with self.assertRaises(AssertionError): pfam2go.GeneOntologies(sample_pfam, fail_ontology) with self.assertRaises(AssertionError): pfam2go.GeneOntologies(fail_pfam, [sample_ontology])
def test_gene_ontologies(self): # does it use arguments given? How is bad input handled? sample_ontology = pfam2go.GeneOntology('GO:0004871', 'signal transducer activity') sample_pfam = 'PF00015' sample_ontologies = pfam2go.GeneOntologies(sample_pfam, [sample_ontology]) assert sample_ontologies.pfam == sample_pfam assert sample_ontologies.go_entries == [sample_ontology] all_entries = [ str(go_entry) for go_entry in sample_ontologies.go_entries ] assert sample_ontology.id in all_entries