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
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
def test_to_hex_cleanup_only(val, expected): assert Webu.toHex(hexstr=val) == expected
def test_to_hex_text(val, expected): assert Webu.toHex(text=val) == expected
def test_to_hex(val, expected): assert Webu.toHex(val) == expected