Home / Function/ test_testserver_allowed() — langchain Function Reference

test_testserver_allowed() — langchain Function Reference

Architecture documentation for the test_testserver_allowed() function in test_ssrf_protection.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a2e0f492_67ec_f59a_b47a_5ae280b5140d["test_testserver_allowed()"]
  55eb5d18_546a_f8ab_e6ce_af072e9c336d["TestValidateSafeUrl"]
  a2e0f492_67ec_f59a_b47a_5ae280b5140d -->|defined in| 55eb5d18_546a_f8ab_e6ce_af072e9c336d
  style a2e0f492_67ec_f59a_b47a_5ae280b5140d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_ssrf_protection.py lines 177–183

    def test_testserver_allowed(self, monkeypatch: Any) -> None:
        """Test that testserver hostname is allowed for test environments."""
        # testserver is used by FastAPI/Starlette test clients
        monkeypatch.setenv("LANGCHAIN_ENV", "local_test")
        url = "http://testserver/webhook"
        result = validate_safe_url(url)
        assert result == url

Domain

Subdomains

Frequently Asked Questions

What does test_testserver_allowed() do?
test_testserver_allowed() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_ssrf_protection.py.
Where is test_testserver_allowed() defined?
test_testserver_allowed() is defined in libs/core/tests/unit_tests/test_ssrf_protection.py at line 177.

Analyze Your Own Codebase

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

Try Supermodel Free