-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: add RANDOMKEY command #396
Python: add RANDOMKEY command #396
Conversation
aaron-congo
commented
Jun 27, 2024
•
edited
Loading
edited
- also updates the redis-rs module to point to the latest commit in redis-rs/main
@@ -285,7 +285,7 @@ impl StandaloneClient { | |||
Some(ResponsePolicy::OneSucceeded) => future::select_ok(requests.map(Box::pin)) | |||
.await | |||
.map(|(result, _)| result), | |||
Some(ResponsePolicy::OneSucceededNonEmpty) => { | |||
Some(ResponsePolicy::FirstSucceededNonEmptyOrAllEmpty) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was renamed in redis-rs, so I had to rename here to get the Rust code to build successfully
@pytest.mark.parametrize("protocol", [ProtocolVersion.RESP2, ProtocolVersion.RESP3]) | ||
async def test_random_key(self, redis_client: TGlideClient): | ||
async def test_cluster_client_random_key(self, redis_client: TGlideClient): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async def test_cluster_client_random_key(self, redis_client: TGlideClient): | |
async def test_cluster_client_random_key(self, redis_client: GlideClusterClient): |
And you can remove assert for client type then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will address all of these when I push to upstream
key = get_random_string(10) | ||
|
||
# set a key in the database in case it was empty | ||
# setup: delete all keys | ||
assert isinstance(redis_client, GlideClusterClient) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert isinstance(redis_client, GlideClusterClient) |
assert await redis_client.exists([result]) == 1 | ||
@pytest.mark.parametrize("cluster_mode", [False]) | ||
@pytest.mark.parametrize("protocol", [ProtocolVersion.RESP2, ProtocolVersion.RESP3]) | ||
async def test_standalone_client_random_key(self, redis_client: TGlideClient): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same in this test