def test_keccak_hexstr(hexstr, digest):
    assert Web3.keccak(hexstr=hexstr) == digest
def test_keccak_primitive_invalid(primitive, exception):
    with pytest.raises(exception):
        Web3.keccak(primitive)
def test_keccak_text(message, digest):
    assert Web3.keccak(text=message) == digest
def test_keccak_raise_if_no_args():
    with pytest.raises(TypeError):
        Web3.keccak()
def test_keccak_raise_if_hexstr_and_text():
    with pytest.raises(TypeError):
        Web3.keccak(hexstr='0x', text='')
def test_keccak_raise_if_primitive_and(kwargs):
    # must not set more than one input
    with pytest.raises(TypeError):
        Web3.keccak('', **kwargs)
def test_keccak_primitive(primitive, digest):
    assert Web3.keccak(primitive) == digest