예제 #1
0
def test_auto_provider_none():
    # init without provider succeeds, even when no provider available
    w3 = Webu()

    # non-node requests succeed
    w3.toHex(0) == '0x0'

    type(w3.providers[0]) == AutoProvider
예제 #2
0
def test_labelhash(ens, label, expected_hash):
    if isinstance(expected_hash, type):
        with pytest.raises(expected_hash):
            ens.labelhash(label)
    else:
        labelhash = ens.labelhash(label)
        assert isinstance(labelhash, bytes)
        hash_hex = Webu.toHex(labelhash)
        assert hash_hex == expected_hash
예제 #3
0
def test_to_hex_cleanup_only(val, expected):
    assert Webu.toHex(hexstr=val) == expected
예제 #4
0
def test_to_hex_text(val, expected):
    assert Webu.toHex(text=val) == expected
예제 #5
0
def test_to_hex(val, expected):
    assert Webu.toHex(val) == expected