Home / Function/ test_no_network_access() — langchain Function Reference

test_no_network_access() — langchain Function Reference

Architecture documentation for the test_no_network_access() function in test_html_security.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d95c6f46_2e18_4f55_3c87_5dde79b306aa["test_no_network_access()"]
  c36248a5_01d0_c9ad_b6b4_e15022cac62c["TestHTMLSectionSplitterSecurity"]
  d95c6f46_2e18_4f55_3c87_5dde79b306aa -->|defined in| c36248a5_01d0_c9ad_b6b4_e15022cac62c
  style d95c6f46_2e18_4f55_3c87_5dde79b306aa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/tests/unit_tests/test_html_security.py lines 61–82

    def test_no_network_access(self) -> None:
        """Test that network access is blocked in parsers."""
        # Create HTML that might trigger network access
        html_with_external_ref = """<?xml version="1.0"?>
<!DOCTYPE html [
  <!ENTITY external SYSTEM "http://attacker.com/xxe">
]>
<html>
  <body>
    <h1>Test</h1>
    <p>&external;</p>
  </body>
</html>"""

        splitter = HTMLSectionSplitter(headers_to_split_on=[("h1", "Header 1")])

        # Process the HTML - should not make network requests
        result = splitter.split_text(html_with_external_ref)

        # Verify no external content is included
        all_content = " ".join([doc.page_content for doc in result])
        assert "attacker.com" not in all_content

Domain

Subdomains

Frequently Asked Questions

What does test_no_network_access() do?
test_no_network_access() is a function in the langchain codebase, defined in libs/text-splitters/tests/unit_tests/test_html_security.py.
Where is test_no_network_access() defined?
test_no_network_access() is defined in libs/text-splitters/tests/unit_tests/test_html_security.py at line 61.

Analyze Your Own Codebase

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

Try Supermodel Free