Esempio n. 1
0
def test_unknown_hash(checksum_type):
    with pytest.raises(ValueError):
        crypto.Checker('a')
Esempio n. 2
0
def test_hash_detection(checksum_type):
    algo = crypto.hash_fun_for_algo(checksum_type)()
    h = 'f' * (algo.digest_size * 2)  # hex -> bytes
    checker = crypto.Checker(h)
    assert checker.hash_name == checksum_type