def test_unknown_hash(checksum_type): with pytest.raises(ValueError): crypto.Checker('a')
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