test: add 23 unit tests for provider endpoints

Cover all 9 endpoints in providers.py:
- Provider presets (list all, get by ID, not found)
- Gmail credential CRUD (create, update, get, delete)
- Import labels update
- Gmail authorize URL (success, not configured)
- Debug email (success, no credentials, injection failure)
- OAuth callback (new/update cred, not configured, token exchange
  failure, missing access token, verification failure)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-29 00:45:50 +00:00
parent 65318b8c1b
commit 4d1451ecde
3 changed files with 711 additions and 0 deletions
+1
View File
@@ -124,6 +124,7 @@ Comprehensive task breakdown for repository improvements and production readines
### In Progress 🔨
- [x] Write unit tests for authentication (22 tests covering register, login, Google OAuth, authorize-url, and helper functions)
- [x] Write unit tests for mail account endpoints (30 tests covering CRUD, toggle, pull-now, test connection, auto-detect, processing runs/logs)
- [x] Write unit tests for provider endpoints (23 tests covering presets, Gmail credential CRUD, import labels, authorize URL, debug email, OAuth callback)
- [ ] Write unit tests for mail processing
- [ ] Write integration tests for API endpoints