You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4.**Context injection** - MCP context provides access to the authenticated client instance
95
+
5.**Modular design** - Each Nextcloud app is isolated in its own client/server pair
96
+
97
+
### Testing Structure
98
+
99
+
-**Integration tests** in `tests/integration/` - Test real Nextcloud API interactions
100
+
-**Fixtures** in `tests/conftest.py` - Shared test setup and utilities
101
+
- Tests are marked with `@pytest.mark.integration` for selective running
102
+
-**Important**: Integration tests run against live Docker containers. After making code changes to the MCP server, rebuild only the MCP container with `docker-compose up --build -d mcp` before running tests
103
+
104
+
#### Testing Best Practices
105
+
-**Always restart MCP server** after code changes with `docker-compose up --build -d mcp`
106
+
-**Use existing fixtures** from `tests/conftest.py` to avoid duplicate setup work:
107
+
-`nc_mcp_client` - MCP client session for tool/resource testing
108
+
-`nc_client` - Direct NextcloudClient for setup/cleanup operations
109
+
-`temporary_note` - Creates and cleans up test notes automatically
110
+
-`temporary_addressbook` - Creates and cleans up test address books
111
+
-`temporary_contact` - Creates and cleans up test contacts
112
+
-**Avoid creating standalone test scripts** - use pytest with proper fixtures instead
113
+
114
+
### Configuration Files
115
+
116
+
-**`pyproject.toml`** - Python project configuration using uv for dependency management
117
+
-**`.env`** (from `env.sample`) - Environment variables for Nextcloud connection
118
+
-**`docker-compose.yml`** - Complete development environment with Nextcloud + database
0 commit comments