Example #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"
Example #2
0
def test_hexstring_length():
    b = HexString("0x1234", "bytes32")
    assert b == "0x1234"
    assert b == "0x000000000000001234"
Example #3
0
def test_hexstring_length(return_value):
    b = HexString('0x1234', "bytes32")
    assert b == "0x1234"
    assert b == "0x000000000000001234"