Home / Function/ test_memories_prefix_enforcement() — langchain Function Reference

test_memories_prefix_enforcement() — langchain Function Reference

Architecture documentation for the test_memories_prefix_enforcement() function in test_anthropic_tools.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7a04170c_cd7e_b9f1_73d9_3c2510c71fa9["test_memories_prefix_enforcement()"]
  6ec57bb9_6c88_435d_d3c5_ccf498cb814d["TestFileOperations"]
  7a04170c_cd7e_b9f1_73d9_3c2510c71fa9 -->|defined in| 6ec57bb9_6c88_435d_d3c5_ccf498cb814d
  style 7a04170c_cd7e_b9f1_73d9_3c2510c71fa9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py lines 161–171

    def test_memories_prefix_enforcement(self) -> None:
        """Test that /memories prefix is enforced for memory middleware."""
        middleware = StateClaudeMemoryMiddleware()

        state: AnthropicToolsState = {"messages": []}

        # Should fail with /other/path
        args = {"command": "create", "path": "/other/path.txt", "file_text": "test"}

        with pytest.raises(ValueError, match="/memories"):
            middleware._handle_create(args, state, "test_id")

Domain

Subdomains

Frequently Asked Questions

What does test_memories_prefix_enforcement() do?
test_memories_prefix_enforcement() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py.
Where is test_memories_prefix_enforcement() defined?
test_memories_prefix_enforcement() is defined in libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py at line 161.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free