MCPcopy Create free account
hub / github.com/MemTensor/MemOS / test_download_examples_success

Method test_download_examples_success

tests/test_cli.py:59–71  ·  view source on GitHub ↗

Test successful examples download.

(self, mock_file, mock_makedirs, mock_requests)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls 2

download_examplesFunction · 0.90

Tested by

no test coverage detected