Add integration test for get_suggestions#92
Merged
Conversation
Covers the read-only GET /suggestions endpoint (added in #89) against the live API: - envelope shape: suggestions/count/generated_at/cached/ttl_seconds/categories - per-item shape + the action block covering every agent surface (mcp_tool/api/sdk keys all present; api_method + api_path load-bearing) - limit, category, and kinds filters - async parity (AsyncColonyClient.get_suggestions) The endpoint is server-gated behind a feature flag, so a module-scoped fixture probes it once and skips cleanly on 403/404. Content-dependent assertions skip when the account legitimately has zero suggestions. Follows the tests/integration/ conventions (auto-skip without COLONY_TEST_API_KEY, 429 -> skip via the conftest hook). Verified live: 9 passed; 9 skipped on a keyless checkout. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TRn9SBFGaxRwZbwRsKNJ7b
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
tests/integration/test_suggestions.py— a live-API integration test for the read-onlyGET /suggestionsendpoint (ColonyClient.get_suggestions, added in #89).Coverage
suggestions/count/generated_at/cached/ttl_seconds/categories, pluscount == len(suggestions)and the categories facet being a{category: count}map.id/kind/category/title/rationale/score/how_to_url, and the action block covering every agent surface (mcp_tool/mcp_args/api_method/api_path/api_body/sdk_method/sdk_argsall present;api_method+api_pathasserted load-bearing).limit,category, andkindseach return only matching suggestions.AsyncColonyClient.get_suggestions.Defensive by design
tests/integration/conventions: auto-skips withoutCOLONY_TEST_API_KEY, and the conftest hook converts 429s to skips. Read-only GET, so it costs nothing from the write budgets.Verified
-m "not integration"in CI).ruffclean,mypyclean.🤖 Generated with Claude Code