Home / Function/ test_upload_single_file() — langchain Function Reference

test_upload_single_file() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/integration_tests/sandboxes.py lines 162–177

    def test_upload_single_file(self, sandbox_backend: SandboxBackendProtocol) -> None:
        """Upload one file and verify its contents on the sandbox."""
        if not self.has_sync:
            pytest.skip("Sync tests not supported.")

        test_path = "/tmp/test_upload_single.txt"
        test_content = b"Hello, Sandbox!"

        upload_responses = sandbox_backend.upload_files([(test_path, test_content)])

        assert len(upload_responses) == 1
        assert upload_responses[0].path == test_path
        assert upload_responses[0].error is None

        result = sandbox_backend.execute(f"cat {test_path}")
        assert result.output.strip() == test_content.decode()

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free