test_delete_operation() — langchain Function Reference
Architecture documentation for the test_delete_operation() function in test_anthropic_tools.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 2879b5c1_0e81_d6c2_9f85_617653abebc3["test_delete_operation()"] 6ec57bb9_6c88_435d_d3c5_ccf498cb814d["TestFileOperations"] 2879b5c1_0e81_d6c2_9f85_617653abebc3 -->|defined in| 6ec57bb9_6c88_435d_d3c5_ccf498cb814d style 2879b5c1_0e81_d6c2_9f85_617653abebc3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py lines 230–252
def test_delete_operation(self) -> None:
"""Test delete command execution (memory only)."""
middleware = StateClaudeMemoryMiddleware()
state: AnthropicToolsState = {
"messages": [],
"memory_files": {
"/memories/test.txt": {
"content": ["line1"],
"created_at": "2025-01-01T00:00:00",
"modified_at": "2025-01-01T00:00:00",
}
},
}
args = {"command": "delete", "path": "/memories/test.txt"}
result = middleware._handle_delete(args, state, "test_id")
assert isinstance(result, Command)
assert result.update is not None
files = result.update.get("memory_files", {})
# Deleted files are marked as None in state
assert files.get("/memories/test.txt") is None
Domain
Subdomains
Source
Frequently Asked Questions
What does test_delete_operation() do?
test_delete_operation() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py.
Where is test_delete_operation() defined?
test_delete_operation() is defined in libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py at line 230.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free