def test_group_to_class_synthetic_one_bad(self): p = ParserBlast("group_to_class_all.xml") p.generate_xml_tree() p.group_to_classes() p.synthetic.append(MainAlignment("Bad example", "123")) values = [re.search("Synthetic", i.title) for i in p.synthetic] self.assertIn(None, values)
def test_divided_to_species__names(self): p = ParserBlast("divided_to_species.xml") p.generate_xml_tree() p.group_to_classes() p.divide_to_species() keys = sorted(['H**o sapiens', "Nomascus leucogenys"]) self.assertListEqual(sorted(p.name_of_species), keys)
def test_group_to_class_all_fill(self): p = ParserBlast("group_to_class_all.xml") p.generate_xml_tree() p.group_to_classes() self.assertTrue( len(p.rest) != 0 and len(p.synthetic) != 0 and len(p.predicted) != 0 and len(p.weird) != 0)
def test_divided_to_species_predicted_names(self): p = ParserBlast("divided_to_species.xml") p.generate_xml_tree() p.group_to_classes() p.divide_to_species_predicted() keys = sorted( ['Pan troglodytes', "Pongo abelii", "Nomascus leucogenys"]) self.assertListEqual(sorted(p.name_of_species_predicted), keys)
def test_divided_to_species_predicted_count(self): p = ParserBlast("divided_to_species.xml") p.generate_xml_tree() p.group_to_classes() p.divide_to_species_predicted() count = 0 for i in p.species_predicted.keys(): count += len(p.species_predicted[i]) self.assertEqual(count, 4)
def test_divided_to_species_predicted_number_uniq(self): p = ParserBlast("divided_to_species.xml") p.generate_xml_tree() p.group_to_classes() p.divide_to_species_predicted() self.assertTrue(len(p.species_predicted) == 3)
def test_group_to_class_synthetic_all_good(self): p = ParserBlast("group_to_class_all.xml") p.generate_xml_tree() p.group_to_classes() values = [re.search("Synthetic", i.title) for i in p.synthetic] self.assertNotIn(None, values)