test_path_traversal_blocked() — langchain Function Reference
Architecture documentation for the test_path_traversal_blocked() function in test_anthropic_tools.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD cd281996_3ab9_a665_33f3_7192025038ae["test_path_traversal_blocked()"] 9599afe1_8f2e_3733_d25a_c88263c5beba["TestPathValidation"] cd281996_3ab9_a665_33f3_7192025038ae -->|defined in| 9599afe1_8f2e_3733_d25a_c88263c5beba style cd281996_3ab9_a665_33f3_7192025038ae fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py lines 27–36
def test_path_traversal_blocked(self) -> None:
"""Test that path traversal attempts are blocked."""
with pytest.raises(ValueError, match="Path traversal not allowed"):
_validate_path("/foo/../etc/passwd")
with pytest.raises(ValueError, match="Path traversal not allowed"):
_validate_path("../etc/passwd")
with pytest.raises(ValueError, match="Path traversal not allowed"):
_validate_path("~/.ssh/id_rsa")
Domain
Subdomains
Source
Frequently Asked Questions
What does test_path_traversal_blocked() do?
test_path_traversal_blocked() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py.
Where is test_path_traversal_blocked() defined?
test_path_traversal_blocked() is defined in libs/partners/anthropic/tests/unit_tests/middleware/test_anthropic_tools.py at line 27.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free