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

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

src/c/o/cogent-1.5.3/tests/test_parse/test_rnaview.py   cogent(Download)
 
from cogent.util.unit_test import TestCase, main
from cogent.parse.rnaview import is_roman_numeral, is_edge, is_orientation,\
    parse_annotation, parse_uncommon_residues, parse_base_pairs,\
    parse_base_multiplets, parse_pair_counts, MinimalRnaviewParser,\
    def test_verify_bp_counts(self):
        """verify_bp_count: should raise an error if bp counts are wrong"""
        lines = RNAVIEW_PDB_REAL.split('\n')
        obs = RnaviewParser(lines)
        # this shouldn't raise an error
        rnaview_lines = RNAVIEW_PDB_REAL.split('\n')
 
        obs = RnaviewParser(rnaview_lines)
        self.assertEqual(obs['FN'], 'pdb430d.ent')
        self.assertEqual(len(obs['UC']),1)
        self.assertRaises(RnaViewParseError, RnaviewParser, lines, strict=True)
 
        obs = RnaviewParser(lines, strict=False)
        self.assertEqual(obs['NP'], None)
        self.assertEqual(obs['BP'][1].Up.ResId, '2')

src/p/y/pycogent-HEAD/tests/test_parse/test_rnaview.py   pycogent(Download)
 
from cogent.util.unit_test import TestCase, main
from cogent.parse.rnaview import is_roman_numeral, is_edge, is_orientation,\
    parse_annotation, parse_uncommon_residues, parse_base_pairs,\
    parse_base_multiplets, parse_pair_counts, MinimalRnaviewParser,\
    def test_verify_bp_counts(self):
        """verify_bp_count: should raise an error if bp counts are wrong"""
        lines = RNAVIEW_PDB_REAL.split('\n')
        obs = RnaviewParser(lines)
        # this shouldn't raise an error
        rnaview_lines = RNAVIEW_PDB_REAL.split('\n')
 
        obs = RnaviewParser(rnaview_lines)
        self.assertEqual(obs['FN'], 'pdb430d.ent')
        self.assertEqual(len(obs['UC']),1)
        self.assertRaises(RnaViewParseError, RnaviewParser, lines, strict=True)
 
        obs = RnaviewParser(lines, strict=False)
        self.assertEqual(obs['NP'], None)
        self.assertEqual(obs['BP'][1].Up.ResId, '2')