Skip to content

Commit

Permalink
test hstrlen
Browse files Browse the repository at this point in the history
  • Loading branch information
amirreza8002 committed Dec 14, 2024
1 parent 263970c commit 344d986
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,13 @@ def test_hvals(self, cache: ValkeyCache):
result = cache.hvals("foo_hash6")
assert result == ["bar1", "bar2"]

def test_hstrlen(self, cache: ValkeyCache):
if isinstance(cache.client, ShardClient):
pytest.skip("ShardClient doesn't support get_client")

cache.hset("hash7", "bar", "baz")
assert cache.hstrlen("hash7", "bar") == 18

def test_sadd(self, cache: ValkeyCache):
assert cache.sadd("foo", "bar") == 1
assert cache.smembers("foo") == {"bar"}
Expand Down
4 changes: 4 additions & 0 deletions tests/tests_async/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,10 @@ async def test_hvals(self, cache: AsyncValkeyCache):
result = await cache.ahvals("foo_hash6")
assert result == ["bar1", "bar2"]

async def test_hstrlen(self, cache: AsyncValkeyCache):
await cache.hset("hash7", "bar", "baz")
assert await cache.ahstrlen("hash7", "bar") == 18

async def test_sadd(self, cache: AsyncValkeyCache):
assert await cache.asadd("foo", "bar") == 1
assert await cache.asmembers("foo") == {"bar"}
Expand Down

0 comments on commit 344d986

Please sign in to comment.