def testParse(self): """Test if all records in a CLA file are being read.""" count = 0 with open(self.filename) as f: records = Cla.parse(f) for record in records: count += 1 self.assertEqual(count, 14)
def testParse(self): """Test if all records in a CLA file are being read""" f=open(self.filename) try: count = 0 records = Cla.parse(f) for record in records: count +=1 self.assertEqual(count, 14) finally: f.close()
def testParse(self): """Test if all records in a CLA file are being read""" f = open(self.filename) try: count = 0 records = Cla.parse(f) for record in records: count += 1 self.assertEqual(count, 14) finally: f.close()
def testParse(self): """Can we parse a CLA file?""" f=open(self.filename) try: count = 0 records = Cla.parse(f) for record in records: count +=1 assert count == 14, "Wrong number of records?!" finally: f.close()