@@ -3162,6 +3162,44 @@ def cmd_init_mock(
31623162class TestClusterPipeline :
31633163 """Tests for the ClusterPipeline class."""
31643164
3165+ async def test_pipeline_nodes_manager_property (self ) -> None :
3166+ """
3167+ Test that ClusterPipeline exposes nodes_manager property
3168+ that delegates to the cluster client's nodes_manager.
3169+ """
3170+ r = await get_mocked_redis_client (host = default_host , port = default_port )
3171+ try :
3172+ pipeline = r .pipeline ()
3173+ # Verify that nodes_manager property exists and returns the same object
3174+ # as the cluster client's nodes_manager
3175+ assert pipeline .nodes_manager is r .nodes_manager
3176+ # Verify that we can access nodes_manager attributes
3177+ assert pipeline .nodes_manager .default_node is not None
3178+ finally :
3179+ await r .aclose ()
3180+
3181+ async def test_pipeline_set_response_callback (self ) -> None :
3182+ """
3183+ Test that ClusterPipeline exposes set_response_callback method
3184+ that delegates to the cluster client's set_response_callback.
3185+ """
3186+ r = await get_mocked_redis_client (host = default_host , port = default_port )
3187+ try :
3188+ pipeline = r .pipeline ()
3189+
3190+ # Define a custom callback
3191+ def custom_callback (response ):
3192+ return f"custom_{ response } "
3193+
3194+ # Set the callback via the pipeline
3195+ pipeline .set_response_callback ("CUSTOM_CMD" , custom_callback )
3196+
3197+ # Verify that the callback was set on the cluster client
3198+ assert "CUSTOM_CMD" in r .response_callbacks
3199+ assert r .response_callbacks ["CUSTOM_CMD" ] is custom_callback
3200+ finally :
3201+ await r .aclose ()
3202+
31653203 async def test_blocked_arguments (self , r : RedisCluster ) -> None :
31663204 """Test handling for blocked pipeline arguments."""
31673205
0 commit comments