Home / Function/ test_validate_path_blocks_tilde() — langchain Function Reference

test_validate_path_blocks_tilde() — langchain Function Reference

Architecture documentation for the test_validate_path_blocks_tilde() function in test_file_search.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  4dae83b3_6f25_324e_2340_a61412b00d84["test_validate_path_blocks_tilde()"]
  e5a178bd_bdb1_3bca_cf3b_735c1d713414["TestPathTraversalSecurity"]
  4dae83b3_6f25_324e_2340_a61412b00d84 -->|defined in| e5a178bd_bdb1_3bca_cf3b_735c1d713414
  style 4dae83b3_6f25_324e_2340_a61412b00d84 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_file_search.py lines 272–280

    def test_validate_path_blocks_tilde(self, tmp_path: Path) -> None:
        """Test that tilde paths are handled safely."""
        middleware = FilesystemFileSearchMiddleware(root_path=str(tmp_path))

        assert isinstance(middleware.glob_search, StructuredTool)
        assert middleware.glob_search.func is not None
        result = middleware.glob_search.func(pattern="*.txt", path="~/")

        assert result == "No files found"

Domain

Subdomains

Frequently Asked Questions

What does test_validate_path_blocks_tilde() do?
test_validate_path_blocks_tilde() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_file_search.py.
Where is test_validate_path_blocks_tilde() defined?
test_validate_path_blocks_tilde() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_file_search.py at line 272.

Analyze Your Own Codebase

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

Try Supermodel Free