Python test

This commit is contained in:
Snack committed 2014-10-15 11:09:37 +09:00
1 parent a809be2fa0
commit 9a94a59b4b
3 files changed
+73 -3

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
# Windows
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# Mac OS X
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
*.pyc
+3 -3
View File
@@ -5,9 +5,9 @@
# md6hash for Python 2, 3
#
# Usage:
# md6 = md6hash();
# data = "md6 FTW";
# result = md6.hex(data);
# md6 = md6hash()
# data = "md6 FTW"
# result = md6.hex(data)
# print(result)
#
+24
View File
@@ -0,0 +1,24 @@
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)