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

All Samples(12)  |  Call(10)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_parse/test_flowgram_parser.py   cogent(Download)
from types import GeneratorType
from cogent.util.unit_test import TestCase, main
from cogent.parse.flowgram_parser import get_header_info, get_summaries,\
    get_all_summaries, split_summary, parse_sff, lazy_parse_sff_handle
 
    def test_get_summaries(self):
        """get_summaries should return a generator of the summaries"""
        summaries = get_summaries(self.rec,number_list = [1])
        sum_list = list(summaries)
        self.assertEqual(len(sum_list), 1)
        self.assertEqual(isinstance(summaries, GeneratorType), True)
        self.assertEqual(len(sum_list[0]), 18)
        self.assertEqual(sum_list[0][0], '>FIQU8OX05F8ILF')
 
        summaries = get_summaries(self.rec,name_list = ['FIQU8OX05GCVRO'])
        self.assertEqual(sum_list[0][0], '>FIQU8OX05GCVRO')
 
        summaries = get_summaries(self.rec,all_sums = True )
        sum_list = list(summaries)
        self.assertEqual(len(sum_list), 2)
        self.assertEqual(sum_list[1][0], '>FIQU8OX05F8ILF')
 
        summaries = get_summaries(self.rec,number_list = [0],
                                 name_list =['FIQU8OX05GCVRO'])
        self.assertRaises(AssertionError,list,summaries)

src/p/y/pycogent-HEAD/tests/test_parse/test_flowgram_parser.py   pycogent(Download)
from types import GeneratorType
from cogent.util.unit_test import TestCase, main
from cogent.parse.flowgram_parser import get_header_info, get_summaries,\
    get_all_summaries, split_summary, parse_sff, lazy_parse_sff_handle
 
    def test_get_summaries(self):
        """get_summaries should return a generator of the summaries"""
        summaries = get_summaries(self.rec,number_list = [1])
        sum_list = list(summaries)
        self.assertEqual(len(sum_list), 1)
        self.assertEqual(isinstance(summaries, GeneratorType), True)
        self.assertEqual(len(sum_list[0]), 18)
        self.assertEqual(sum_list[0][0], '>FIQU8OX05F8ILF')
 
        summaries = get_summaries(self.rec,name_list = ['FIQU8OX05GCVRO'])
        self.assertEqual(sum_list[0][0], '>FIQU8OX05GCVRO')
 
        summaries = get_summaries(self.rec,all_sums = True )
        sum_list = list(summaries)
        self.assertEqual(len(sum_list), 2)
        self.assertEqual(sum_list[1][0], '>FIQU8OX05F8ILF')
 
        summaries = get_summaries(self.rec,number_list = [0],
                                 name_list =['FIQU8OX05GCVRO'])
        self.assertRaises(AssertionError,list,summaries)