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)
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())
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")
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()
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')
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()
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()
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()