def test_is_delegate_returns_true_if_is_delegate(redis): public_key = "020f5df4d2bc736d12ce43af5b1663885a893fade7ee5e62b3cc59315a63e6a325" manager = WalletManager() redis.set( "wallets:address:AThM5PNSKdU9pu1ydqQnzRWVeNCGr8HKof", json.dumps({"username": "******"}), ) redis.set("wallets:username:test", "") assert manager.is_delegate(public_key) is True
def test_is_delegate_returns_false_if_not_a_delegate(redis): public_key = "020f5df4d2bc736d12ce43af5b1663885a893fade7ee5e62b3cc59315a63e6a325" manager = WalletManager() redis.set("wallets:address:AThM5PNSKdU9pu1ydqQnzRWVeNCGr8HKof", json.dumps({})) assert manager.is_delegate(public_key) is False