def loopBackTest(classRef, value): s = StringIO() o = classRef() o.write(WriteContext(s), value) s.seek(0) r = hessian.readObject(ParseContext(s)) res = False try: res = r == value except RuntimeError: # Fall-back in case of recursion error res = `r` == `value` assert res
def loopBackTest(classRef, value): s = StringIO() o = classRef() o.write(WriteContext(s), value) s.seek(0) r = hessian.readObject(ParseContext(s)) res = False try: res = r == value except RuntimeError: # Fall-back in case of recursion error res = ` r ` == ` value ` assert res
def wr(val): s = StringIO() hessian.Date().write(WriteContext(s), datetime.fromtimestamp(val)) s.seek(0) return hessian.readObject(ParseContext(s))