Author: Martin Matusiak <numero...@gmail.com> Branch: py3.3-fixes3 Changeset: r72863:51ec894e3d52 Date: 2014-08-17 20:17 +0200 http://bitbucket.org/pypy/pypy/changeset/51ec894e3d52/
Log: add tests for .name attribute on sha objects diff --git a/pypy/module/test_lib_pypy/test_sha_extra.py b/pypy/module/test_lib_pypy/test_sha_extra.py --- a/pypy/module/test_lib_pypy/test_sha_extra.py +++ b/pypy/module/test_lib_pypy/test_sha_extra.py @@ -37,3 +37,30 @@ assert _sha.sha1().digest_size == 20 assert _sha.sha1().digestsize == 20 assert _sha.sha1().block_size == 64 + + assert _sha.sha().name == 'sha' + assert _sha.sha1().name == 'sha1' + + +class AppTestSHA256: + spaceconfig = dict(usemodules=('struct',)) + + def setup_class(cls): + cls.w__sha256 = import_lib_pypy(cls.space, '_sha256') + + def test_attributes(self): + _sha256 = self._sha256 + assert _sha256.sha224().name == 'sha224' + assert _sha256.sha256().name == 'sha256' + + +class AppTestSHA512: + spaceconfig = dict(usemodules=('struct',)) + + def setup_class(cls): + cls.w__sha512 = import_lib_pypy(cls.space, '_sha512') + + def test_attributes(self): + _sha512 = self._sha512 + assert _sha512.sha384().name == 'sha384' + assert _sha512.sha512().name == 'sha512' _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit