(*_args, **_kwargs)
| 185 | with patch.object(Redis, class="st">"execute_command") as execute_command_mock: |
| 186 | |
| 187 | def execute_command(*_args, **_kwargs): |
| 188 | if _args[0] == class="st">"CLUSTER SLOTS": |
| 189 | if cluster_slots_raise_error: |
| 190 | raise ResponseError() |
| 191 | else: |
| 192 | mock_cluster_slots = cluster_slots |
| 193 | return mock_cluster_slots |
| 194 | elif _args[0] == class="st">"COMMAND": |
| 195 | return {class="st">"get": [], class="st">"set": []} |
| 196 | elif _args[0] == class="st">"INFO": |
| 197 | return {class="st">"cluster_enabled": cluster_enabled} |
| 198 | elif len(_args) > 1 and _args[1] == class="st">"cluster-require-full-coverage": |
| 199 | return {class="st">"cluster-require-full-coverage": coverage_res} |
| 200 | elif func is not None: |
| 201 | return func(*args, **kwargs) |
| 202 | else: |
| 203 | return execute_command_mock(*_args, **_kwargs) |
| 204 | |
| 205 | execute_command_mock.side_effect = execute_command |
| 206 |
nothing calls this directly
no test coverage detected