-
Notifications
You must be signed in to change notification settings - Fork 53
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: adds HSTRLEN command #1564
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -909,6 +909,21 @@ async def test_hrandfield_withvalues(self, redis_client: TRedisClient): | |
with pytest.raises(RequestError): | ||
await redis_client.hrandfield_withvalues(key2, 5) | ||
|
||
@pytest.mark.parametrize("cluster_mode", [True, False]) | ||
@pytest.mark.parametrize("protocol", [ProtocolVersion.RESP2, ProtocolVersion.RESP3]) | ||
async def test_hstrlen(self, redis_client: TRedisClient): | ||
key = get_random_string(10) | ||
|
||
assert await redis_client.hstrlen(key, "field") == 0 | ||
assert await redis_client.hset(key, {"field": "value"}) == 1 | ||
assert await redis_client.hstrlen(key, "field") == 5 | ||
|
||
assert await redis_client.hstrlen(key, "field2") == 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure why you have this test, since you're already testing the non-existing field case on line 873 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 873 is for non-existing key, I think it's nice to have both |
||
|
||
await redis_client.set(key, "value") | ||
with pytest.raises(RequestError): | ||
await redis_client.hstrlen(key, "field") | ||
|
||
@pytest.mark.parametrize("cluster_mode", [True, False]) | ||
@pytest.mark.parametrize("protocol", [ProtocolVersion.RESP2, ProtocolVersion.RESP3]) | ||
async def test_lpush_lpop_lrange(self, redis_client: TRedisClient): | ||
|
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.
❤️