# SandboxIntegrationTests

> **Class** in `langchain_tests`

📖 [View in docs](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests)

Standard integration tests for a `SandboxBackendProtocol` implementation.

## Signature

```python
SandboxIntegrationTests()
```

## Extends

- `BaseStandardTests`

## Properties

- `sandbox_root_dir`
- `has_sync`
- `has_async`

## Methods

- [`sandbox_path()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/sandbox_path)
- [`sandbox_backend()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/sandbox_backend)
- [`sandbox()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/sandbox)
- [`sandbox_test_root()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/sandbox_test_root)
- [`test_write_new_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_new_file)
- [`test_read_basic_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_basic_file)
- [`test_read_binary_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_binary_file)
- [`test_read_binary_file_100_kib()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_binary_file_100_kib)
- [`test_read_binary_file_1_mib_returns_error()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_binary_file_1_mib_returns_error)
- [`test_execute_large_stdout_payload()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_execute_large_stdout_payload)
- [`test_edit_single_occurrence()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_edit_single_occurrence)
- [`test_ls_lists_files()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_ls_lists_files)
- [`test_glob()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_glob)
- [`test_grep_literal()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_literal)
- [`test_upload_single_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_upload_single_file)
- [`test_download_single_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_download_single_file)
- [`test_upload_download_roundtrip()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_upload_download_roundtrip)
- [`test_upload_multiple_files_order_preserved()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_upload_multiple_files_order_preserved)
- [`test_download_multiple_files_order_preserved()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_download_multiple_files_order_preserved)
- [`test_upload_binary_content_roundtrip()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_upload_binary_content_roundtrip)
- [`test_upload_large_file_reports_expected_size()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_upload_large_file_reports_expected_size)
- [`test_download_error_file_not_found()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_download_error_file_not_found)
- [`test_download_error_is_directory()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_download_error_is_directory)
- [`test_download_error_permission_denied()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_download_error_permission_denied)
- [`test_download_error_invalid_path_relative()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_download_error_invalid_path_relative)
- [`test_upload_missing_parent_dir_or_roundtrip()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_upload_missing_parent_dir_or_roundtrip)
- [`test_upload_relative_path_returns_invalid_path()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_upload_relative_path_returns_invalid_path)
- [`test_write_creates_parent_dirs()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_creates_parent_dirs)
- [`test_write_existing_file_fails()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_existing_file_fails)
- [`test_write_special_characters()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_special_characters)
- [`test_write_empty_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_empty_file)
- [`test_write_path_with_spaces()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_path_with_spaces)
- [`test_write_unicode_content()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_unicode_content)
- [`test_write_consecutive_slashes_in_path()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_consecutive_slashes_in_path)
- [`test_write_very_long_content()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_very_long_content)
- [`test_write_content_with_only_newlines()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_content_with_only_newlines)
- [`test_read_nonexistent_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_nonexistent_file)
- [`test_read_empty_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_empty_file)
- [`test_read_with_offset()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_with_offset)
- [`test_read_with_limit()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_with_limit)
- [`test_read_with_offset_and_limit()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_with_offset_and_limit)
- [`test_read_unicode_content()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_unicode_content)
- [`test_read_file_with_very_long_lines()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_file_with_very_long_lines)
- [`test_read_with_zero_limit()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_with_zero_limit)
- [`test_read_offset_beyond_file_length()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_offset_beyond_file_length)
- [`test_read_offset_at_exact_file_length()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_offset_at_exact_file_length)
- [`test_read_very_large_file_in_chunks()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_very_large_file_in_chunks)
- [`test_edit_multiple_occurrences_without_replace_all()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_edit_multiple_occurrences_without_replace_all)
- [`test_edit_multiple_occurrences_with_replace_all()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_edit_multiple_occurrences_with_replace_all)
- [`test_edit_string_not_found()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_edit_string_not_found)
- [`test_edit_nonexistent_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_edit_nonexistent_file)
- [`test_edit_special_characters()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_edit_special_characters)
- [`test_edit_multiline_support()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_edit_multiline_support)
- [`test_ls_lists_nested_directories()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_ls_lists_nested_directories)
- [`test_ls_unicode_filenames()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_ls_unicode_filenames)
- [`test_ls_large_directory()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_ls_large_directory)
- [`test_ls_path_with_trailing_slash()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_ls_path_with_trailing_slash)
- [`test_ls_special_characters_in_filenames()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_ls_special_characters_in_filenames)
- [`test_ls_path_is_sanitized()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_ls_path_is_sanitized)
- [`test_read_path_is_sanitized()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_read_path_is_sanitized)
- [`test_grep_basic_search()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_basic_search)
- [`test_grep_with_glob_pattern()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_with_glob_pattern)
- [`test_grep_no_matches()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_no_matches)
- [`test_grep_multiple_matches_per_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_multiple_matches_per_file)
- [`test_grep_literal_string_matching()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_literal_string_matching)
- [`test_grep_unicode_pattern()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_unicode_pattern)
- [`test_grep_case_sensitivity()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_case_sensitivity)
- [`test_grep_with_special_characters()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_with_special_characters)
- [`test_grep_empty_directory()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_empty_directory)
- [`test_grep_across_nested_directories()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_across_nested_directories)
- [`test_grep_with_globstar_include_pattern()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_with_globstar_include_pattern)
- [`test_grep_reports_correct_line_numbers()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_grep_reports_correct_line_numbers)
- [`test_glob_basic_pattern()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_glob_basic_pattern)
- [`test_glob_recursive_pattern()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_glob_recursive_pattern)
- [`test_glob_no_matches()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_glob_no_matches)
- [`test_glob_with_directories()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_glob_with_directories)
- [`test_glob_hidden_files_explicitly()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_glob_hidden_files_explicitly)
- [`test_glob_with_character_class()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_glob_with_character_class)
- [`test_glob_with_question_mark()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_glob_with_question_mark)
- [`test_awrite_aread_large_text_payload()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_awrite_aread_large_text_payload)
- [`test_aread_large_text_payload_paginated_roundtrip()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_aread_large_text_payload_paginated_roundtrip)
- [`test_adownload_large_text_payload_roundtrip()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_adownload_large_text_payload_roundtrip)
- [`test_write_read_download_large_text_with_escaped_content()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_write_read_download_large_text_with_escaped_content)
- [`test_awrite_aread_adownload_large_text_with_escaped_content()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_awrite_aread_adownload_large_text_with_escaped_content)
- [`test_aread_binary_image_file()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_aread_binary_image_file)
- [`test_aread_binary_file_100_kib()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_aread_binary_file_100_kib)
- [`test_aread_binary_file_1_mib_returns_error()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_aread_binary_file_1_mib_returns_error)
- [`test_aexecute_large_stdout_payload()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_aexecute_large_stdout_payload)
- [`test_aupload_adownload_large_file_roundtrip()`](https://reference.langchain.com/python/langchain-tests/integration_tests/sandboxes/SandboxIntegrationTests/test_aupload_adownload_large_file_roundtrip)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/311675a517f51ec6c77454124293c58df517e952/libs/standard-tests/langchain_tests/integration_tests/sandboxes.py#L64)