MCPcopy
hub / github.com/redis/redis-py / test_client_setinfo

Method test_client_setinfo

tests/test_asyncio/test_commands.py:546–565  ·  view source on GitHub ↗
(self, r: redis.Redis)

Source from the content-addressed store, hash-verified

544
545 @skip_if_server_version_lt("7.2.0")
546 async def test_client_setinfo(self, r: redis.Redis):
547 from redis.utils import get_lib_version
548
549 await r.ping()
550 info = await r.client_info()
551 assert info["lib-name"] == "redis-py"
552 assert info["lib-ver"] == get_lib_version()
553 assert await r.client_setinfo("lib-name", "test")
554 assert await r.client_setinfo("lib-ver", "123")
555 info = await r.client_info()
556 assert info["lib-name"] == "test"
557 assert info["lib-ver"] == "123"
558
559 # Test deprecated lib_name/lib_version parameters
560 with pytest.warns(DeprecationWarning):
561 r2 = redis.Redis(lib_name="test2", lib_version="1234")
562 info = await r2.client_info()
563 assert info["lib-name"] == "test2"
564 assert info["lib-ver"] == "1234"
565 await r2.aclose()
566
567 @skip_if_server_version_lt("7.2.0")
568 async def test_client_setinfo_with_driver_info(self, r: redis.Redis):

Callers

nothing calls this directly

Calls 5

acloseMethod · 0.95
get_lib_versionFunction · 0.90
client_infoMethod · 0.80
client_setinfoMethod · 0.80
pingMethod · 0.45

Tested by

no test coverage detected