Formatting
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
"""Edge case tests for PromptBuilder."""
|
||||
import pytest
|
||||
import json
|
||||
|
||||
|
||||
from agent.prompts import PromptBuilder
|
||||
from agent.registry import make_tools
|
||||
from infrastructure.persistence import get_memory
|
||||
|
||||
|
||||
class TestPromptBuilderEdgeCases:
|
||||
@@ -93,11 +91,13 @@ class TestPromptBuilderEdgeCases:
|
||||
def test_prompt_with_many_active_downloads(self, memory):
|
||||
"""Should limit displayed active downloads."""
|
||||
for i in range(20):
|
||||
memory.episodic.add_active_download({
|
||||
"task_id": str(i),
|
||||
"name": f"Download {i}",
|
||||
"progress": i * 5,
|
||||
})
|
||||
memory.episodic.add_active_download(
|
||||
{
|
||||
"task_id": str(i),
|
||||
"name": f"Download {i}",
|
||||
"progress": i * 5,
|
||||
}
|
||||
)
|
||||
|
||||
tools = make_tools()
|
||||
builder = PromptBuilder(tools)
|
||||
@@ -136,12 +136,15 @@ class TestPromptBuilderEdgeCases:
|
||||
|
||||
def test_prompt_with_complex_workflow(self, memory):
|
||||
"""Should handle complex workflow state."""
|
||||
memory.stm.start_workflow("download", {
|
||||
"title": "Test Movie",
|
||||
"year": 2024,
|
||||
"quality": "1080p",
|
||||
"nested": {"deep": {"value": "test"}},
|
||||
})
|
||||
memory.stm.start_workflow(
|
||||
"download",
|
||||
{
|
||||
"title": "Test Movie",
|
||||
"year": 2024,
|
||||
"quality": "1080p",
|
||||
"nested": {"deep": {"value": "test"}},
|
||||
},
|
||||
)
|
||||
memory.stm.update_workflow_stage("searching_torrents")
|
||||
|
||||
tools = make_tools()
|
||||
@@ -313,11 +316,14 @@ class TestFormatEpisodicContextEdgeCases:
|
||||
|
||||
def test_format_with_search_results_none_names(self, memory):
|
||||
"""Should handle results with None names."""
|
||||
memory.episodic.store_search_results("test", [
|
||||
{"name": None},
|
||||
{"title": None},
|
||||
{},
|
||||
])
|
||||
memory.episodic.store_search_results(
|
||||
"test",
|
||||
[
|
||||
{"name": None},
|
||||
{"title": None},
|
||||
{},
|
||||
],
|
||||
)
|
||||
|
||||
tools = make_tools()
|
||||
builder = PromptBuilder(tools)
|
||||
|
||||
Reference in New Issue
Block a user