Back to index

python-biopython  1.60
Public Member Functions | Public Attributes
test_SCOP_Des.DesTests 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 15 of file test_SCOP_Des.py.


Member Function Documentation

Definition at line 17 of file test_SCOP_Des.py.

00017 
00018     def setUp(self):
00019         self.filename = './SCOP/dir.des.scop.txt_test'

Test if a corrupt record raises the appropriate exception

Definition at line 43 of file test_SCOP_Des.py.

00043 
00044     def testError(self):
00045         """Test if a corrupt record raises the appropriate exception"""
00046         corruptRec = "49268\tsp\tb.1.2.1\t-\n"
00047         self.assertRaises(ValueError, Des.Record, corruptRec)

Test if all records in a DES file are being read

Definition at line 20 of file test_SCOP_Des.py.

00020 
00021     def testParse(self):
00022         """Test if all records in a DES file are being read"""
00023         f = open(self.filename)
00024         try: 
00025             count = 0
00026             records = Des.parse(f)
00027             for record in records:
00028                 count +=1
00029             self.assertEqual(count, 20)
00030         finally:
00031             f.close()
    

Here is the call graph for this function:

Test one record in detail

Definition at line 48 of file test_SCOP_Des.py.

00048 
00049     def testRecord(self):
00050         """Test one record in detail"""
00051         recLine = '49268\tsp\tb.1.2.1\t-\tHuman (Homo sapiens)    \n'
00052         recFields = (49268,'sp','b.1.2.1','','Human (Homo sapiens)')
00053 
00054         record = Des.Record(recLine)
00055         self.assertEqual(record.sunid, recFields[0])
00056         self.assertEqual(record.nodetype, recFields[1])
00057         self.assertEqual(record.sccs, recFields[2])
00058         self.assertEqual(record.name, recFields[3])
00059         self.assertEqual(record.description, recFields[4])
00060 
00061 

Test if we can convert each record to a string correctly

Definition at line 32 of file test_SCOP_Des.py.

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

Here is the call graph for this function:


Member Data Documentation

Definition at line 18 of file test_SCOP_Des.py.


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