Create mock zip file content for testing.
(self)
| 44 | """Test the download_examples function.""" |
| 45 | |
| 46 | def create_mock_zip_content(self): |
| 47 | """Create mock zip file content for testing.""" |
| 48 | zip_buffer = BytesIO() |
| 49 | with zipfile.ZipFile(zip_buffer, "w") as zip_file: |
| 50 | zip_file.writestr("MemOS-main/examples/test_example.py", "# Test example content") |
| 51 | zip_file.writestr( |
| 52 | "MemOS-main/examples/subfolder/another_example.py", "# Another example" |
| 53 | ) |
| 54 | return zip_buffer.getvalue() |
| 55 | |
| 56 | @patch("requests.get") |
| 57 | @patch("os.makedirs") |
no outgoing calls
no test coverage detected