33
44from  redis .asyncio .multidb .database  import  Database 
55from  redis .asyncio .multidb .healthcheck  import  (
6-     EchoHealthCheck ,
6+     PingHealthCheck ,
77    LagAwareHealthCheck ,
88    HealthCheck ,
99    HealthyAllPolicy ,
@@ -208,15 +208,15 @@ async def test_policy_raise_unhealthy_database_exception_if_exception_occurs_on_
208208
209209
210210@pytest .mark .onlynoncluster  
211- class  TestEchoHealthCheck :
211+ class  TestPingHealthCheck :
212212    @pytest .mark .asyncio  
213213    async  def  test_database_is_healthy_on_echo_response (self , mock_client , mock_cb ):
214214        """ 
215215        Mocking responses to mix error and actual responses to ensure that health check retry 
216216        according to given configuration. 
217217        """ 
218-         mock_client .execute_command  =  AsyncMock (side_effect = ["healthcheck " ])
219-         hc  =  EchoHealthCheck ()
218+         mock_client .execute_command  =  AsyncMock (side_effect = ["PONG " ])
219+         hc  =  PingHealthCheck ()
220220        db  =  Database (mock_client , mock_cb , 0.9 )
221221
222222        assert  await  hc .check_health (db )
@@ -230,8 +230,8 @@ async def test_database_is_unhealthy_on_incorrect_echo_response(
230230        Mocking responses to mix error and actual responses to ensure that health check retry 
231231        according to given configuration. 
232232        """ 
233-         mock_client .execute_command  =  AsyncMock (side_effect = ["wrong" ])
234-         hc  =  EchoHealthCheck ()
233+         mock_client .execute_command  =  AsyncMock (side_effect = [False ])
234+         hc  =  PingHealthCheck ()
235235        db  =  Database (mock_client , mock_cb , 0.9 )
236236
237237        assert  not  await  hc .check_health (db )
@@ -241,9 +241,9 @@ async def test_database_is_unhealthy_on_incorrect_echo_response(
241241    async  def  test_database_close_circuit_on_successful_healthcheck (
242242        self , mock_client , mock_cb 
243243    ):
244-         mock_client .execute_command  =  AsyncMock (side_effect = ["healthcheck " ])
244+         mock_client .execute_command  =  AsyncMock (side_effect = ["PONG " ])
245245        mock_cb .state  =  CBState .HALF_OPEN 
246-         hc  =  EchoHealthCheck ()
246+         hc  =  PingHealthCheck ()
247247        db  =  Database (mock_client , mock_cb , 0.9 )
248248
249249        assert  await  hc .check_health (db )
0 commit comments