(sandbox: Sandbox)
| 74 | |
| 75 | |
| 76 | def test_write(sandbox: Sandbox): |
| 77 | # Create a file and open it in a text editor |
| 78 | text_file_path = "/home/user/test.txt" |
| 79 | sandbox.files.write(text_file_path, "hello") |
| 80 | sandbox.open(text_file_path) |
| 81 | # Add an assertion here, perhaps check if the content is correct |
| 82 | content = sandbox.files.read(text_file_path) |
| 83 | assert content == "hello", ( |
| 84 | f"Expected content 'hello' in {text_file_path}, but got {content}" |
| 85 | ) |