Exemple #1
0
            def side_effect(self, *args, **kwargs):
                def ok_call(self, *args, **kwargs):
                    assert self.port == 7007
                    return "OK"
                parse_response_mock.side_effect = ok_call

                raise ClusterDownError('CLUSTERDOWN The cluster is down. Use CLUSTER INFO for more information')
Exemple #2
0
 def side_effect(self, *args, **kwargs):
     if self.port == 7006:
         parse_response_mock.failed_calls += 1
         raise ClusterDownError(
             'CLUSTERDOWN The cluster is down. Use CLUSTER INFO for more information'
         )
     elif self.port == 7007:
         parse_response_mock.successful_calls += 1
Exemple #3
0
 def bad_func():
     raise ClusterDownError("CLUSTERDOWN")