Home / Function/ test_upload_missing_parent_dir_or_roundtrip() — langchain Function Reference

test_upload_missing_parent_dir_or_roundtrip() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/integration_tests/sandboxes.py lines 358–389

    def test_upload_missing_parent_dir_or_roundtrip(
        self,
        sandbox_backend: SandboxBackendProtocol,
    ) -> None:
        """Uploading into a missing parent dir should error or roundtrip.

        Some sandboxes auto-create parent directories; others return an error.
        """
        if not self.has_sync:
            pytest.skip("Sync tests not supported.")

        dir_path = "/tmp/test_upload_missing_parent_dir"
        path = f"{dir_path}/deepagents_test_upload.txt"
        content = b"nope"
        sandbox_backend.execute(f"rm -rf {dir_path}")

        responses = sandbox_backend.upload_files([(path, content)])
        assert len(responses) == 1
        assert responses[0].path == path

        if responses[0].error is not None:
            assert responses[0].error in {
                "invalid_path",
                "permission_denied",
                "file_not_found",
            }
            return

        download = sandbox_backend.download_files([path])
        assert download == [
            FileDownloadResponse(path=path, content=content, error=None)
        ]

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free