@@ -526,7 +526,7 @@ def test_tool_registry_replace_existing_tool():
526526
527527 registry = ToolRegistry ()
528528 registry .register_tool (old_tool )
529- registry .replace ("my_tool" , new_tool )
529+ registry .replace (new_tool )
530530
531531 assert registry .registry ["my_tool" ] == new_tool
532532
@@ -539,24 +539,7 @@ def test_tool_registry_replace_nonexistent_tool():
539539 registry = ToolRegistry ()
540540
541541 with pytest .raises (ValueError , match = "Cannot replace tool 'my_tool' - tool does not exist" ):
542- registry .replace ("my_tool" , new_tool )
543-
544-
545- def test_tool_registry_replace_with_different_name ():
546- """Test replacing with different name raises ValueError."""
547- old_tool = MagicMock ()
548- old_tool .tool_name = "old_tool"
549- old_tool .is_dynamic = False
550- old_tool .supports_hot_reload = False
551-
552- new_tool = MagicMock ()
553- new_tool .tool_name = "new_tool"
554-
555- registry = ToolRegistry ()
556- registry .register_tool (old_tool )
557-
558- with pytest .raises (ValueError , match = "Tool names must match" ):
559- registry .replace ("old_tool" , new_tool )
542+ registry .replace (new_tool )
560543
561544
562545def test_tool_registry_replace_dynamic_tool ():
@@ -572,7 +555,7 @@ def test_tool_registry_replace_dynamic_tool():
572555
573556 registry = ToolRegistry ()
574557 registry .register_tool (old_tool )
575- registry .replace ("dynamic_tool" , new_tool )
558+ registry .replace (new_tool )
576559
577560 assert registry .registry ["dynamic_tool" ] == new_tool
578561 assert registry .dynamic_tools ["dynamic_tool" ] == new_tool
@@ -594,7 +577,7 @@ def test_tool_registry_replace_dynamic_with_non_dynamic():
594577
595578 assert "my_tool" in registry .dynamic_tools
596579
597- registry .replace ("my_tool" , new_tool )
580+ registry .replace (new_tool )
598581
599582 assert registry .registry ["my_tool" ] == new_tool
600583 assert "my_tool" not in registry .dynamic_tools
@@ -616,7 +599,7 @@ def test_tool_registry_replace_non_dynamic_with_dynamic():
616599
617600 assert "my_tool" not in registry .dynamic_tools
618601
619- registry .replace ("my_tool" , new_tool )
602+ registry .replace (new_tool )
620603
621604 assert registry .registry ["my_tool" ] == new_tool
622605 assert registry .dynamic_tools ["my_tool" ] == new_tool
0 commit comments