File: test_pdb.py

package info (click to toggle)
python-cogent 1.5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 16,424 kB
  • ctags: 24,343
  • sloc: python: 134,200; makefile: 100; ansic: 17; sh: 10
file content (27 lines) | stat: -rw-r--r-- 824 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
"""Tests of data retrieval from PDB."""
from cogent.util.unit_test import TestCase, main
from cogent.db.pdb import Pdb

__author__ = "Rob Knight"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Rob Knight"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Rob Knight"
__email__ = "rob@spot.colorado.edu"
__status__ = "Production"

class PdbTests(TestCase):
    """Tests of the Pdb class."""
    def test_simple_get(self):
        """Simple access of an item should work."""
        rec = Pdb()
        result = rec['1RMN'].read()
        assert result.startswith('HEADER')
        assert result.rstrip().endswith('END') #note: trailing whitespace
        assert 'HAMMERHEAD RIBOZYME' in result
        assert '1RMN' in result

if __name__ == '__main__':
    main()