17 lines
539 B
Python
17 lines
539 B
Python
from types import SimpleNamespace
|
|
|
|
from nanobot.config.schema import Config, ToolsConfig
|
|
from nanobot.agent.tools.filesystem import FileToolsConfig, ReadFileTool
|
|
|
|
|
|
def test_file_tools_enabled_by_default():
|
|
assert FileToolsConfig().enable is True
|
|
assert Config().tools.file.enable is True
|
|
|
|
|
|
def test_file_tool_gate_follows_flag():
|
|
cfg = ToolsConfig()
|
|
cfg.file.enable = False
|
|
assert ReadFileTool.enabled(SimpleNamespace(config=cfg)) is False
|
|
assert ReadFileTool.enabled(SimpleNamespace(config=ToolsConfig())) is True
|