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

Function execute_command

tests/test_asyncio/test_cluster.py:174–188  ·  view source on GitHub ↗
(*_args, **_kwargs)

Source from the content-addressed store, hash-verified

172 with mock.patch.object(ClusterNode, "execute_command") as execute_command_mock:
173
174 async def execute_command(*_args, **_kwargs):
175 if _args[0] == "CLUSTER SLOTS":
176 if cluster_slots_raise_error:
177 raise ResponseError()
178 else:
179 mock_cluster_slots = cluster_slots
180 return mock_cluster_slots
181 elif _args[0] == "COMMAND":
182 return {"get": [], "set": []}
183 elif _args[0] == "INFO":
184 return {"cluster_enabled": cluster_enabled}
185 elif len(_args) > 1 and _args[1] == "cluster-require-full-coverage":
186 return {"cluster-require-full-coverage": coverage_res}
187 else:
188 return await execute_command_mock(*_args, **_kwargs)
189
190 execute_command_mock.side_effect = execute_command
191

Callers

nothing calls this directly

Calls 1

ResponseErrorClass · 0.90

Tested by

no test coverage detected