Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_parse/test_blast_xml.py   cogent(Download)
 
from cogent.util.unit_test import main, TestCase
from cogent.parse.blast_xml import BlastXMLResult, MinimalBlastParser7,\
     get_tag, parse_hsp, parse_hit, parse_header, parse_parameters,\
     HSP_XML_FIELDNAMES, HIT_XML_FIELDNAMES
    def test_parse_hit(self):
        """Should return a list with all values for a hit+hsp."""
        data = parse_hit(self.hit1)
        self.assertEqual(len(data),1)
        d = dict(zip(HIT_XML_FIELDNAMES,data[0]))
        self.assertEqual(int(d['HIT_LENGTH']),707)
        # check hit with more HSPs
        data = parse_hit(self.hit2)
        self.assertEqual(len(data),2)
        self.assertNotEqual(data[0],data[1])

src/p/y/pycogent-HEAD/tests/test_parse/test_blast_xml.py   pycogent(Download)
 
from cogent.util.unit_test import main, TestCase
from cogent.parse.blast_xml import BlastXMLResult, MinimalBlastParser7,\
     get_tag, parse_hsp, parse_hit, parse_header, parse_parameters,\
     HSP_XML_FIELDNAMES, HIT_XML_FIELDNAMES
    def test_parse_hit(self):
        """Should return a list with all values for a hit+hsp."""
        data = parse_hit(self.hit1)
        self.assertEqual(len(data),1)
        d = dict(zip(HIT_XML_FIELDNAMES,data[0]))
        self.assertEqual(int(d['HIT_LENGTH']),707)
        # check hit with more HSPs
        data = parse_hit(self.hit2)
        self.assertEqual(len(data),2)
        self.assertNotEqual(data[0],data[1])