Test main function with download_examples command.
(self, mock_download)
| 85 | |
| 86 | @patch("memos.cli.download_examples") |
| 87 | def test_main_download_examples(self, mock_download): |
| 88 | """Test main function with download_examples command.""" |
| 89 | mock_download.return_value = True |
| 90 | |
| 91 | with patch("sys.argv", ["memos", "download_examples", "--dest", "/test/dest"]): |
| 92 | with pytest.raises(SystemExit) as exc_info: |
| 93 | main() |
| 94 | assert exc_info.value.code == 0 |
| 95 | mock_download.assert_called_once_with("/test/dest") |
| 96 | |
| 97 | @patch("memos.cli.export_openapi") |
| 98 | def test_main_export_openapi(self, mock_export): |