Buckets:
| import os | |
| from server import ( | |
| write_file, | |
| read_file, | |
| list_directory, | |
| get_file_info, | |
| delete_path, | |
| create_directory | |
| ) | |
| TEST_FILE = "test_data.txt" | |
| TEST_DIR = "test_folder" | |
| def test_write_read(): | |
| print("Testing Write/Read...") | |
| write_file(TEST_FILE, "Line 1\nLine 2\nLine 3") | |
| content = read_file(TEST_FILE, start_line=1, end_line=2) | |
| assert "Line 1\nLine 2" in content | |
| print("PASSED") | |
| def test_directory_ops(): | |
| print("Testing Directory Ops...") | |
| create_directory(TEST_DIR) | |
| items = list_directory(".") | |
| assert TEST_DIR in items | |
| print("PASSED") | |
| def test_file_info(): | |
| print("Testing File Info...") | |
| info = get_file_info(TEST_FILE) | |
| assert info["name"] == TEST_FILE | |
| assert info["size_bytes"] > 0 | |
| print("PASSED") | |
| def cleanup(): | |
| print("Cleaning up...") | |
| if os.path.exists(TEST_FILE): os.remove(TEST_FILE) | |
| if os.path.exists(TEST_DIR): os.rmdir(TEST_DIR) | |
| print("Cleanup DONE") | |
| if __name__ == "__main__": | |
| try: | |
| test_write_read() | |
| test_directory_ops() | |
| test_file_info() | |
| print("\nAll Filesystem MCP tests passed!") | |
| finally: | |
| cleanup() | |
Xet Storage Details
- Size:
- 1.16 kB
- Xet hash:
- f5c29f764fc4af148df8ab0afe3e4e43ea0f3dc75ff9bc4edae0d6b0b538ea90
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.