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

Method test_export_openapi_error

tests/test_cli.py:35–40  ·  view source on GitHub ↗

Test OpenAPI export when file writing fails.

(self, mock_file, mock_app)

Source from the content-addressed store, hash-verified

33 @patch("memos.cli.get_openapi_app")
34 @patch("builtins.open", side_effect=OSError("Permission denied"))
35 def test_export_openapi_error(self, mock_file, mock_app):
36 """Test OpenAPI export when file writing fails."""
37 mock_app.return_value.openapi.return_value = {"test": "data"}
38
39 with pytest.raises(IOError):
40 export_openapi("/invalid/path/openapi.json")
41
42
43class TestDownloadExamples:

Callers

nothing calls this directly

Calls 1

export_openapiFunction · 0.90

Tested by

no test coverage detected