Example #1
0
 def testParse(self):
     """Test if all records in a DOM file are being read."""
     count = 0
     with open(self.filename) as f:
         for record in Dom.parse(f):
             count += 1
     self.assertEqual(count, 10)
Example #2
0
 def testStr(self):
     """Test if we can convert each record to a string correctly."""
     with open(self.filename) as f:
         for line in f:
             record = Dom.Record(line)
             # End of line is platform dependent. Strip it off
             self.assertEqual(str(record).rstrip(), line.rstrip())
Example #3
0
    def testRecord(self):
        """Test one record in detail."""
        recLine = "d7hbib_\t7hbi\tb:\t1.001.001.001.001.001"

        rec = Dom.Record(recLine)
        self.assertEqual(rec.sid, "d7hbib_")
        self.assertEqual(rec.residues.pdbid, "7hbi")
        self.assertEqual(rec.residues.fragments, (("b", "", ""), ))
        self.assertEqual(rec.hierarchy, "1.001.001.001.001.001")
Example #4
0
 def testParse(self):
     f = open(self.filename)
     try:
         count = 0
         for record in Dom.parse(f):
             count += 1
         self.assertEquals(count, 10)
     finally:
         f.close()
Example #5
0
    def testRecord(self):
        """Test one record in detail"""
        recLine = 'd7hbib_\t7hbi\tb:\t1.001.001.001.001.001'

        rec = Dom.Record(recLine)
        self.assertEqual(rec.sid, 'd7hbib_')
        self.assertEqual(rec.residues.pdbid, '7hbi')
        self.assertEqual(rec.residues.fragments, (('b', '', ''), ))
        self.assertEqual(rec.hierarchy, '1.001.001.001.001.001')
Example #6
0
 def testStr(self):
     """Test if we can convert each record to a string correctly"""
     f = open(self.filename)
     try:
         for line in f:
             record = Dom.Record(line)
             # End of line is platform dependent. Strip it off
             self.assertEqual(str(record).rstrip(), line.rstrip())
     finally:
         f.close()
Example #7
0
 def testParse(self):
     """Test if all records in a DOM file are being read"""
     f = open(self.filename)
     try:
         count = 0
         for record in Dom.parse(f):
             count += 1
         self.assertEqual(count, 10)
     finally:
         f.close()
Example #8
0
 def testParse(self):
     """Test if all records in a DOM file are being read"""
     f = open(self.filename)
     try:
         count = 0
         for record in Dom.parse(f):
             count +=1
         self.assertEqual(count, 10)
     finally:
         f.close()