Commit ad58d8a
test: Add comprehensive tests for v2 API endpoints
Add complete test coverage for all v2 API endpoints using integer IDs:
Knowledge router tests (14 tests):
- Resolve identifier by permalink
- Get entity by ID
- Create entity with observations/relations
- Update entity by ID (PUT)
- Edit entity (PATCH with append/find_replace)
- Delete entity by ID
- Move entity (ID stability)
- Error handling (404s)
- V2-specific features (api_version field)
Project router tests (14 tests):
- Get project by ID
- Update project (path, active status)
- Set default project by ID
- Delete project by ID
- Delete with delete_notes parameter
- Error handling (404s, validation)
- ID stability after operations
All tests properly use entity_repository to look up entity IDs
after creation, as EntityResponse doesn't expose ID field.
Project tests use project_service.add_project() to ensure
projects exist in both database and configuration.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 9207052 commit ad58d8a
3 files changed
Lines changed: 658 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments