Files
md6/test/test.py
T
2014-10-15 11:09:37 +09:00

24 lines
353 B
Python

import sys
sys.path.append("..")
from md6 import md6hash
md6 = md6hash()
f = open("result.csv", "r")
result = f.readlines()
f.close()
total = 0
ok = 0
for line in result:
size, data, comp = line.strip().split(",")
size = int(size)
hash = md6.hex(data, size)
total += 1
if hash == comp:
ok += 1
print "%d / %d test(s) passed." % (ok, total)