(self, r)
| 2214 | |
| 2215 | @skip_if_server_version_lt("6.2.0") |
| 2216 | async def test_hrandfield(self, r): |
| 2217 | assert await r.hrandfield("key") is None |
| 2218 | await r.hset("key", mapping={"a": 1, "b": 2, "c": 3, "d": 4, "e": 5}) |
| 2219 | assert await r.hrandfield("key") is not None |
| 2220 | assert len(await r.hrandfield("key", 2)) == 2 |
| 2221 | # with values |
| 2222 | assert_resp_response(r, len(await r.hrandfield("key", 2, True)), 4, 2) |
| 2223 | # without duplications |
| 2224 | assert len(await r.hrandfield("key", 10)) == 5 |
| 2225 | # with duplications |
| 2226 | assert len(await r.hrandfield("key", -10)) == 10 |
| 2227 | |
| 2228 | @pytest.mark.onlynoncluster |
| 2229 | async def test_randomkey(self, r: redis.Redis): |
nothing calls this directly
no test coverage detected