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