test.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:rehash 作者: kislyuk 项目源码 文件源码
def test_basic_statements(self):
        for algorithm in hashlib.algorithms_guaranteed:
            if algorithm.startswith("blake2") or algorithm.startswith("sha3") or algorithm.startswith("shake"):
                with self.assertRaises(Exception):
                    rehash.ResumableHasher(algorithm.lower())
            else:
                print(algorithm)
                self.assert_resumable(rehash.new(algorithm.lower()))
                self.assert_resumable(rehash.new(algorithm.lower(), b"initial_data"))
                self.assert_resumable(rehash.ResumableHasher(algorithm.lower()))
                self.assert_resumable(rehash.ResumableHasher(algorithm.lower(), b"initial_data"))
                self.assert_resumable(getattr(rehash, algorithm)())
                self.assert_resumable(getattr(rehash, algorithm)(b"initial_data"))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号