Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_SCOP_Dom.DomTests Class Reference

List of all members.

Public Member Functions

def setUp
def testParse
def testStr
def testError
def testRecord

Public Attributes

 filename

Detailed Description

Definition at line 19 of file test_SCOP_Dom.py.


Member Function Documentation

Definition at line 20 of file test_SCOP_Dom.py.

00020 
00021     def setUp(self):
00022         self.filename = './SCOP/testDom.txt'

Test if a corrupt record raises the appropriate exception

Definition at line 45 of file test_SCOP_Dom.py.

00045 
00046     def testError(self):
00047         """Test if a corrupt record raises the appropriate exception"""
00048         corruptDom = "49xxx268\tsp\tb.1.2.1\t-\n"
00049         self.assertRaises(ValueError, Dom.Record, corruptDom)
00050 

Test if all records in a DOM file are being read

Definition at line 23 of file test_SCOP_Dom.py.

00023 
00024     def testParse(self):
00025         """Test if all records in a DOM file are being read"""
00026         f = open(self.filename)
00027         try: 
00028             count = 0
00029             for record in Dom.parse(f):
00030                 count +=1
00031             self.assertEqual(count,10)
00032         finally:
00033             f.close()
    

Here is the call graph for this function:

Test one record in detail

Definition at line 51 of file test_SCOP_Dom.py.

00051 
00052     def testRecord(self):
00053         """Test one record in detail"""
00054         recLine = 'd7hbib_\t7hbi\tb:\t1.001.001.001.001.001'
00055 
00056         rec = Dom.Record(recLine)
00057         self.assertEqual(rec.sid, 'd7hbib_')
00058         self.assertEqual(rec.residues.pdbid,'7hbi')
00059         self.assertEqual(rec.residues.fragments,(('b','',''),) )        
00060         self.assertEqual(rec.hierarchy,'1.001.001.001.001.001')
00061 
00062 

Test if we can convert each record to a string correctly

Definition at line 34 of file test_SCOP_Dom.py.

00034 
00035     def testStr(self):
00036         """Test if we can convert each record to a string correctly"""
00037         f = open(self.filename)
00038         try: 
00039             for line in f:
00040                 record = Dom.Record(line)
00041                 #End of line is platform dependent. Strip it off
00042                 self.assertEqual(str(record).rstrip(),line.rstrip())
00043         finally:
00044             f.close()

Here is the call graph for this function:


Member Data Documentation

Definition at line 21 of file test_SCOP_Dom.py.


The documentation for this class was generated from the following file: