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