Author: Alex Gaynor <[email protected]>
Branch: kill-faking
Changeset: r59281:5a39ec9e6538
Date: 2012-12-02 16:53 -0800
http://bitbucket.org/pypy/pypy/changeset/5a39ec9e6538/
Log: Fixed _hashlib, _md5, and _sha tests.
diff --git a/pypy/module/_hashlib/test/test_hashlib.py
b/pypy/module/_hashlib/test/test_hashlib.py
--- a/pypy/module/_hashlib/test/test_hashlib.py
+++ b/pypy/module/_hashlib/test/test_hashlib.py
@@ -1,7 +1,7 @@
-import py
-
class AppTestHashlib:
- spaceconfig = dict(usemodules=['_hashlib', 'array', 'struct'])
+ spaceconfig = {
+ "usemodules": ['_hashlib', 'array', 'struct', 'binascii'],
+ }
def test_simple(self):
import _hashlib
diff --git a/pypy/module/_md5/test/test_md5.py
b/pypy/module/_md5/test/test_md5.py
--- a/pypy/module/_md5/test/test_md5.py
+++ b/pypy/module/_md5/test/test_md5.py
@@ -5,7 +5,7 @@
class AppTestMD5(object):
spaceconfig = {
- "usemodules": ['_md5', 'rctime'],
+ "usemodules": ['_md5', 'rctime', 'binascii'],
}
def setup_class(cls):
@@ -26,7 +26,6 @@
assert self.md5.blocksize == 1
assert self.md5.md5().digestsize == 16
-
def test_MD5Type(self):
"""
Test the two ways to construct an md5 object.
@@ -39,7 +38,6 @@
d = md5.new()
assert isinstance(d, md5.MD5Type)
-
def test_md5object(self):
"""
Feed example strings into a md5 object and check the digest and
@@ -59,7 +57,7 @@
"c3fcd3d76192e4007dfb496cca67e13b"),
("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
"d174ab98d277d9f5a5611c2c9f419d9f"),
- ("1234567890"*8,
+ ("1234567890" * 8,
"57edf4a22be3c955ac49da2e2107b67a"),
)
for input, expected in cases:
@@ -67,7 +65,6 @@
assert d.hexdigest() == expected
assert d.digest() == expected.decode('hex')
-
def test_copy(self):
"""
Test the copy() method.
@@ -81,7 +78,6 @@
assert d1.hexdigest() == 'e570e7110ecef72fcb772a9c05d03373'
assert d2.hexdigest() == 'e8dc4081b13434b45189a720b77b6818'
-
def test_buffer(self):
"""
Test passing a buffer object.
@@ -91,7 +87,6 @@
d1.update(buffer("jkl"))
assert d1.hexdigest() == 'e570e7110ecef72fcb772a9c05d03373'
-
def test_unicode(self):
"""
Test passing unicode strings.
diff --git a/pypy/module/_sha/test/test_sha.py
b/pypy/module/_sha/test/test_sha.py
--- a/pypy/module/_sha/test/test_sha.py
+++ b/pypy/module/_sha/test/test_sha.py
@@ -5,7 +5,7 @@
class AppTestSHA(object):
spaceconfig = {
- "usemodules": ['_sha', 'rctime'],
+ "usemodules": ['_sha', 'rctime', 'binascii'],
}
def setup_class(cls):
@@ -25,7 +25,6 @@
assert d.digest_size == 20
assert d.digestsize == 20
-
def test_SHAType(self):
"""
Test the two ways to construct an sha object.
@@ -38,7 +37,6 @@
d = sha.new()
assert isinstance(d, sha.SHAType)
-
def test_shaobject(self):
"""
Feed example strings into a sha object and check the digest and
@@ -56,7 +54,7 @@
"c12252ceda8be8994d5fa0290a47231c1d16aae3"),
("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
"761c457bf73b14d27e9e9265c46f4b4dda11f940"),
- ("1234567890"*8,
+ ("1234567890" * 8,
"50abf5706a150990a08b2c5ea40fa0e585554732"),
("1234567890"*999,
"eaaca5490568fde98d8dc553d9566bdc602fde4a"),
@@ -66,7 +64,6 @@
assert d.hexdigest() == expected
assert d.digest() == expected.decode('hex')
-
def test_copy(self):
"""
Test the copy() method.
@@ -80,7 +77,6 @@
assert d1.hexdigest() == 'f5d13cf6341db9b0e299d7b9d562de9572b58e5d'
assert d2.hexdigest() == '425af12a0743502b322e93a015bcf868e324d56a'
-
def test_buffer(self):
"""
Test passing a buffer object.
@@ -90,7 +86,6 @@
d1.update(buffer("jkl"))
assert d1.hexdigest() == 'f5d13cf6341db9b0e299d7b9d562de9572b58e5d'
-
def test_unicode(self):
"""
Test passing unicode strings.
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit