Exemplo n.º 1
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 = Hie.Record(line)
             # End of line is platform dependent. Strip it off
             self.assertEqual(str(record).rstrip(), line.rstrip())
Exemplo n.º 2
0
    def testError(self):
        corruptRec = "4926sdfhjhfgyjdfyg"

        try:
            rec = Hie.Record(corruptRec)
            assert False, "Should never get here"
        except ValueError, e:
            pass
Exemplo n.º 3
0
 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()
Exemplo n.º 4
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 = Hie.Record(line)
             #End of line is platform dependent. Strip it off
             self.assertEqual(str(record).rstrip(), line.rstrip())
     finally:
         f.close()