Ejemplo n.º 1
0
def test_hexstring_typeerror():
    b = HexString("0x1234", "bytes32")
    with pytest.raises(TypeError):
        b == "potato"
    with pytest.raises(TypeError):
        b == "1234"
    assert str(b) != "potato"
Ejemplo n.º 2
0
def test_hexstring_length():
    b = HexString("0x1234", "bytes32")
    assert b == "0x1234"
    assert b == "0x000000000000001234"
Ejemplo n.º 3
0
def test_hexstring_length(return_value):
    b = HexString('0x1234', "bytes32")
    assert b == "0x1234"
    assert b == "0x000000000000001234"