Test successful examples download.
(self, mock_file, mock_makedirs, mock_requests)
| 57 | @patch("os.makedirs") |
| 58 | @patch("builtins.open", new_callable=mock_open) |
| 59 | def test_download_examples_success(self, mock_file, mock_makedirs, mock_requests): |
| 60 | """Test successful examples download.""" |
| 61 | mock_response = MagicMock() |
| 62 | mock_response.content = self.create_mock_zip_content() |
| 63 | mock_requests.return_value = mock_response |
| 64 | |
| 65 | result = download_examples("/test/dest") |
| 66 | |
| 67 | assert result is True |
| 68 | mock_requests.assert_called_once_with( |
| 69 | "https://github.com/MemTensor/MemOS/archive/refs/heads/main.zip" |
| 70 | ) |
| 71 | mock_response.raise_for_status.assert_called_once() |
| 72 | |
| 73 | @patch("requests.get") |
| 74 | def test_download_examples_error(self, mock_requests): |
nothing calls this directly
no test coverage detected