Add comprehensive unit tests for UniversityPlugin and GeminiChatCompletionFactory#16
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
Conversation
…etionFactory - Create test infrastructure with fixtures and conftest.py - Implement 19 unit tests for UniversityPlugin covering: * Successful searches and error handling * Network failures and malformed responses * Result limits (10 for name search, 20 for country search) * URL construction and parameter handling - Implement 16 unit tests for GeminiChatCompletionFactory covering: * Factory initialization with valid/missing API keys * Service creation for all supported Gemini models * Model type detection and structured output support * Default model behavior and custom service IDs - All tests are isolated with no external dependencies - Total execution time: <2 seconds for 35 tests - 100% coverage for GeminiChatCompletionFactory - All tests pass lint checks with ruff
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Description
This PR adds comprehensive isolated unit tests for two components in the teal-agents platform:
UniversityPlugin(from assistant-orchestrator example)GeminiChatCompletionFactory(from sk-agents core)All tests use mocked dependencies to ensure no external API calls are made during test execution.
Link to Devin run: https://app.devin.ai/sessions/cd405e0e45544468a117496c39d4e670
Requested by: Shawn Azman (@ShawnAzman)
Changes
Test Infrastructure
tests/conftest.pywith shared pytest fixtures:university_api_responses: Loads mock university API response datamock_app_config: Mocked AppConfig for testingmock_requests_response: Reusable mock response objecttests/fixtures/university_api_responses.jsonwith realistic test datatests/unit/directory structureUniversityPlugin Tests (19 tests)
GeminiChatCompletionFactory Tests (16 tests)
Test Results
Type of Change
Important Review Notes
sys.pathmanipulation with a complex relative path to import fromsrc/orchestrators/assistant-orchestrator/example/university/. This works but is fragile - consider whether:# noqa: E402to suppress linting warnings about imports after sys.path modification - this is necessary but worth noting.Review Checklist
Please verify: