Home / Function/ test_download_error_permission_denied() — langchain Function Reference

test_download_error_permission_denied() — langchain Function Reference

Architecture documentation for the test_download_error_permission_denied() function in sandboxes.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  534e319e_6271_177a_bc31_a05a2553e0f8["test_download_error_permission_denied()"]
  44713bb8_64c7_b8af_22f9_b6db34868592["SandboxIntegrationTests"]
  534e319e_6271_177a_bc31_a05a2553e0f8 -->|defined in| 44713bb8_64c7_b8af_22f9_b6db34868592
  style 534e319e_6271_177a_bc31_a05a2553e0f8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/integration_tests/sandboxes.py lines 314–338

    def test_download_error_permission_denied(
        self, sandbox_backend: SandboxBackendProtocol
    ) -> None:
        """Downloading a chmod 000 file should fail with a reasonable error code."""
        if not self.has_sync:
            pytest.skip("Sync tests not supported.")

        test_path = "/tmp/test_no_read.txt"
        sandbox_backend.execute(
            f"rm -f {test_path} && echo secret > {test_path} && chmod 000 {test_path}"
        )

        try:
            responses = sandbox_backend.download_files([test_path])
        finally:
            sandbox_backend.execute(f"chmod 644 {test_path} || true")

        assert len(responses) == 1
        assert responses[0].path == test_path
        assert responses[0].content is None
        assert responses[0].error in {
            "permission_denied",
            "file_not_found",
            "invalid_path",
        }

Domain

Subdomains

Frequently Asked Questions

What does test_download_error_permission_denied() do?
test_download_error_permission_denied() is a function in the langchain codebase, defined in libs/standard-tests/langchain_tests/integration_tests/sandboxes.py.
Where is test_download_error_permission_denied() defined?
test_download_error_permission_denied() is defined in libs/standard-tests/langchain_tests/integration_tests/sandboxes.py at line 314.

Analyze Your Own Codebase

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

Try Supermodel Free