Skip to content

Conversation

@goblin0xcrypto
Copy link
Contributor

Add Comprehensive Test Coverage for DeepSeekLLM Plugin

Summary

This PR adds comprehensive unit tests for the DeepSeekLLM plugin to improve code quality and maintainability.


Test Coverage

⚙️ Configuration & Initialization Tests

  • Test successful initialization with provided configuration
  • Test fallback to default model (deepseek-chat) when model is not specified
  • Test validation that raises ValueError when API key is missing
  • Test configuration with custom base URL and model

🧠 Core Functionality Tests

  • Test successful API request without tool calls (returns None)
  • Test successful API request with single tool call
  • Test successful API request with multiple tool calls
  • Test handling of empty response choices (returns None)
  • Test handling of invalid JSON responses (returns empty CortexOutputModel)

🛠️ Error Handling Tests

  • Test graceful error handling for API exceptions (returns None)
  • Test malformed message handling (missing role or content)

📜 Message History Tests

  • Test API call with message history
  • Test correct message formatting and ordering

📊 Performance & Monitoring Tests

  • Test I/O provider timing metrics collection (llm_start_time and llm_end_time)
  • Test timeout configuration is properly passed to API

Files Changed

  • tests/llm/plugins/test_deepseek_llm.py (new)

@goblin0xcrypto goblin0xcrypto requested a review from a team as a code owner January 28, 2026 17:23
@github-actions github-actions bot added python Python code tests Test files labels Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant