コード例 #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"