Home / Function/ test_mset_chmod() — langchain Function Reference

test_mset_chmod() — langchain Function Reference

Architecture documentation for the test_mset_chmod() function in test_filesystem.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  9e4ae9fa_8c46_9729_3314_c158d12d5ecc["test_mset_chmod()"]
  dc21888b_994e_4dfd_2387_4da22b01f8de["test_filesystem.py"]
  9e4ae9fa_8c46_9729_3314_c158d12d5ecc -->|defined in| dc21888b_994e_4dfd_2387_4da22b01f8de
  style 9e4ae9fa_8c46_9729_3314_c158d12d5ecc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/storage/test_filesystem.py lines 36–59

def test_mset_chmod(chmod_dir_s: str, chmod_file_s: str) -> None:
    chmod_dir = int(chmod_dir_s, base=8)
    chmod_file = int(chmod_file_s, base=8)

    # Create a temporary directory for testing
    with tempfile.TemporaryDirectory() as temp_dir:
        # Instantiate the LocalFileStore with a directory inside the temporary directory
        # as the root path
        file_store = LocalFileStore(
            Path(temp_dir) / "store_dir",
            chmod_dir=chmod_dir,
            chmod_file=chmod_file,
        )

        # Set values for keys
        key_value_pairs = [("key1", b"value1"), ("key2", b"value2")]
        file_store.mset(key_value_pairs)

        # verify the permissions are set correctly
        # (test only the standard user/group/other bits)
        dir_path = file_store.root_path
        file_path = file_store.root_path / "key1"
        assert (dir_path.stat().st_mode & 0o777) == chmod_dir
        assert (file_path.stat().st_mode & 0o777) == chmod_file

Domain

Subdomains

Frequently Asked Questions

What does test_mset_chmod() do?
test_mset_chmod() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/storage/test_filesystem.py.
Where is test_mset_chmod() defined?
test_mset_chmod() is defined in libs/langchain/tests/unit_tests/storage/test_filesystem.py at line 36.

Analyze Your Own Codebase

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

Try Supermodel Free