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_greengenes.py   cogent(Download)
#!/usr/bin/env python
 
from cogent.util.unit_test import TestCase, main
from cogent.parse.greengenes import MinimalGreengenesParser, make_ignore_f,\
        DefaultDelimitedSplitter, SpecificGreengenesParser
    def test_SpecificGreengenesParser_real(self):
        """Test SpecificGreengenesParser against real data"""
        fields = ['prokMSA_id','journal']
        res = SpecificGreengenesParser(real_data.splitlines(), fields)
        records = list(res)
        exp = [('604868',''),('604867','ISME J (2010) In press')]
        self.assertEqual(records, exp)
 
        ids = ['604867','12312312323']
        res = SpecificGreengenesParser(real_data.splitlines(), fields, ids)

src/p/y/pycogent-HEAD/tests/test_parse/test_greengenes.py   pycogent(Download)
#!/usr/bin/env python
 
from cogent.util.unit_test import TestCase, main
from cogent.parse.greengenes import MinimalGreengenesParser, make_ignore_f,\
        DefaultDelimitedSplitter, SpecificGreengenesParser
    def test_SpecificGreengenesParser_real(self):
        """Test SpecificGreengenesParser against real data"""
        fields = ['prokMSA_id','journal']
        res = SpecificGreengenesParser(real_data.splitlines(), fields)
        records = list(res)
        exp = [('604868',''),('604867','ISME J (2010) In press')]
        self.assertEqual(records, exp)
 
        ids = ['604867','12312312323']
        res = SpecificGreengenesParser(real_data.splitlines(), fields, ids)