55
66import pytest
77from strands .agent import Agent
8- from strands .models import BedrockModel
98
109from strands_agents_builder import strands
1110
1211
1312@pytest .fixture
1413def tmp_file_structure (tmp_path : Path ):
1514 """Creates a temporary directory structure for tool creation and returns paths."""
16- tools_dir = tmp_path / ".strand " / "tools"
15+ tools_dir = tmp_path / ".strands " / "tools"
1716 tools_dir .mkdir (parents = True , exist_ok = True )
1817 return {"tools_dir" : tools_dir , "root_dir" : tmp_path }
1918
2019
21- @pytest .fixture
22- def bedrock_model ():
23- return BedrockModel (
24- model_id = "us.anthropic.claude-3-7-sonnet-20250219-v1:0" ,
25- streaming = True ,
26- )
27-
28-
2920@mock .patch .object (sys , "stdin" )
3021@mock .patch .object (sys , "argv" )
3122@mock .patch ("os.chdir" )
3223@mock .patch ("os.getcwd" )
3324@mock .patch .dict ("os.environ" , {"STRANDS_TOOL_CONSOLE_MODE" : "enabled" , "STRANDS_KNOWLEDGE_BASE_ID" : "test-kb-cli" })
3425def test_mock_cli_create_calculator_then_validate (
35- mock_getcwd , mock_chdir , mock_argv , mock_stdin , capsys , tmp_file_structure : dict , bedrock_model
26+ mock_getcwd , mock_chdir , mock_argv , mock_stdin , capsys , tmp_file_structure : dict
3627):
3728 """
3829 Test creating a calculator tool via CLI and validating its functionality.
@@ -49,7 +40,6 @@ def test_mock_cli_create_calculator_then_validate(
4940 strands .main ()
5041
5142 agent = Agent (
52- model = bedrock_model ,
5343 load_tools_from_directory = True ,
5444 )
5545
@@ -80,7 +70,7 @@ def test_cli_query_with_kb(mock_argv, capsys):
8070@mock .patch .object (sys , "argv" )
8171@mock .patch ("os.chdir" )
8272@mock .patch ("os.getcwd" )
83- @mock .patch .dict ("os.environ" , {"STRANDS_TOOL_CONSOLE_MODE" : "enabled" , "STRANDS_KNOWLEDGE_BASE_ID" : "test-kb-cli" })
73+ @mock .patch .dict ("os.environ" , {"STRANDS_TOOL_CONSOLE_MODE" : "enabled" })
8474def test_cli_with_custom_tool_load_tool (
8575 mock_getcwd , mock_chdir , mock_argv , mock_user_input , capsys , tmp_file_structure
8676):
@@ -117,7 +107,7 @@ def reverse_text(text: str) -> dict:
117107
118108@mock .patch .object (strands , "get_user_input" )
119109@mock .patch .object (sys , "argv" )
120- @mock .patch .dict ("os.environ" , {"STRANDS_TOOL_CONSOLE_MODE" : "enabled" , "STRANDS_KNOWLEDGE_BASE_ID" : "test-kb-cli" })
110+ @mock .patch .dict ("os.environ" , {"STRANDS_TOOL_CONSOLE_MODE" : "enabled" })
121111def test_cli_shell_and_interactive_mode (mock_argv , mock_user_input , capsys ):
122112 """Test interactive mode with a shell command."""
123113 mock_argv .__getitem__ .side_effect = lambda i : ["strands" ][i ]
0 commit comments