Debian Codegraph @

extra_tests/test_hashlib.py

raw symbols SCIP
1 import hashlib
2 import pytest
3
4 def test_python_names():
5 for algo in hashlib.algorithms_available:
6 hashlib.new(algo)
7 # these used to crash
8 hashlib.new("md5_sha1")
9 hashlib.new("sha512_224")
10 hashlib.new("sha512_256")
11
12 def test_large_hmac():
13 # issue 3962: problem with large msg code path
14 import hmac
15 m = hmac.HMAC(b'', msg=b'0'*2049, digestmod='sha256')
16 assert len(m.digest()) == 32
17
18 def test_crash():
19 # issue 5127
20 with pytest.raises((AttributeError, TypeError)):
21 hashlib.shake_128()._keccak_init(())
22
23