예제 #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')
예제 #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
예제 #3
0
 def bad_func():
     raise ClusterDownError("CLUSTERDOWN")