py3port: update tests

This commit is contained in:
The MMGen Project 2018-10-31 18:20:59 +00:00
commit 0eff2811e1
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
8 changed files with 233 additions and 165 deletions

View file

@ -76,6 +76,10 @@ def run_test(test,arg,input_data):
cls = globals()[test]
ret = cls(*args,**kwargs)
bad_ret = list() if issubclass(cls,list) else None
if issubclass(type(ret_chk),str): ret_chk = ret_chk.encode()
if issubclass(type(ret),str): ret = ret.encode()
if (opt.silent and input_data=='bad' and ret!=bad_ret) or (not opt.silent and input_data=='bad'):
raise UserWarning("Non-'None' return value {} with bad input data".format(repr(ret)))
if opt.silent and input_data=='good' and ret==bad_ret: