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

Method execute_command

tests/test_cluster.py:2946–2957  ·  view source on GitHub ↗
(*_args, **_kwargs)

Source from the content-addressed store, hash-verified

2944 with patch.object(Redis, "execute_command") as execute_command_mock:
2945
2946 def execute_command(*_args, **_kwargs):
2947 if _args[0] == "CLUSTER SLOTS":
2948 mock_cluster_slots = cluster_slots_results.pop(0)
2949 return mock_cluster_slots
2950 elif _args[0] == "COMMAND":
2951 return {"get": [], "set": []}
2952 elif _args[0] == "INFO":
2953 return {"cluster_enabled": True}
2954 elif len(_args) > 1 and _args[1] == "cluster-require-full-coverage":
2955 return {"cluster-require-full-coverage": False}
2956 else:
2957 return execute_command_mock(*_args, **_kwargs)
2958
2959 execute_command_mock.side_effect = execute_command
2960

Calls

no outgoing calls

Tested by

no test coverage detected