mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-21 03:46:11 +00:00
refactor(agent-runner): use sandbox file model
This commit is contained in:
@@ -534,36 +534,6 @@ class TestIsResourceAllowed:
|
||||
|
||||
assert registry.is_resource_allowed(session, 'unknown_type', 'something') is False
|
||||
|
||||
def test_file_allowed(self):
|
||||
"""File in resources should be allowed."""
|
||||
registry = AgentRunSessionRegistry()
|
||||
resources = make_resources(
|
||||
files=[
|
||||
{'file_id': 'file_001'},
|
||||
{'file_id': 'file_002'},
|
||||
]
|
||||
)
|
||||
session = make_session(resources=resources)
|
||||
|
||||
assert registry.is_resource_allowed(session, 'file', 'file_001') is True
|
||||
assert registry.is_resource_allowed(session, 'file', 'file_002') is True
|
||||
|
||||
def test_file_not_allowed(self):
|
||||
"""File not in resources should be denied."""
|
||||
registry = AgentRunSessionRegistry()
|
||||
resources = make_resources(files=[{'file_id': 'file_001'}])
|
||||
session = make_session(resources=resources)
|
||||
|
||||
assert registry.is_resource_allowed(session, 'file', 'file_999') is False
|
||||
|
||||
def test_file_empty_resources(self):
|
||||
"""Empty files list should deny all."""
|
||||
registry = AgentRunSessionRegistry()
|
||||
resources = make_resources(files=[])
|
||||
session = make_session(resources=resources)
|
||||
|
||||
assert registry.is_resource_allowed(session, 'file', 'file_001') is False
|
||||
|
||||
def test_missing_resources_field(self):
|
||||
"""Missing resources field should not raise."""
|
||||
registry = AgentRunSessionRegistry()
|
||||
|
||||
Reference in New Issue
Block a user