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 = Hie.Record(line) # End of line is platform dependent. Strip it off self.assertEqual(str(record).rstrip(), line.rstrip())
def testError(self): corruptRec = "4926sdfhjhfgyjdfyg" try: rec = Hie.Record(corruptRec) assert False, "Should never get here" except ValueError, e: pass
def testStr(self): f = open(self.filename) try: for line in f: record = Hie.Record(line) #End of line is platform dependent. Strip it off assert str(record).rstrip() == line.rstrip() finally: f.close()
def testStr(self): """Test if we can convert each record to a string correctly""" f = open(self.filename) try: for line in f: record = Hie.Record(line) #End of line is platform dependent. Strip it off self.assertEqual(str(record).rstrip(), line.rstrip()) finally: f.close()