Skip to content

test: add comprehensive tests for MinimaxAPIClient (0% -> 100% coverage)#75

Open
hell0gunawan wants to merge 2 commits intoMiniMax-AI:mainfrom
hell0gunawan:test/coverage-expand
Open

test: add comprehensive tests for MinimaxAPIClient (0% -> 100% coverage)#75
hell0gunawan wants to merge 2 commits intoMiniMax-AI:mainfrom
hell0gunawan:test/coverage-expand

Conversation

@hell0gunawan
Copy link
Copy Markdown

Summary

Adds 16 unit tests covering the MinimaxAPIClient class — achieving 100% line coverage (up from 0%).

What was tested

16 tests covering:

  • Client initialization (api_key, host, session, headers)
  • _make_request method (success path, 4xx, 5xx errors)
  • API error codes: 1004 (auth), 2038 (real-name verification), generic
  • Connection/timeout error handling
  • get() and post() helper methods

Coverage results

minimax_mcp/client.py       → 100%
minimax_mcp/exceptions.py   → 100%
minimax_mcp/const.py        → 100%

Addresses

Closes #72test: expand test coverage — only utils tested, server and client have zero tests

Adds 16 unit tests covering:
- Client initialization (api_key, host, session, headers)
- _make_request method (success, 4xx, 5xx, API errors)
- API error codes: 1004 (auth), 2038 (real-name), generic
- Connection/timeout error handling
- get() and post() helper methods

Addresses issue MiniMax-AI#72: 'test: expand test coverage — only utils tested,
server and client have zero tests'
- Test all 9 MCP tool functions: text_to_audio, list_voices, voice_clone,
  play_audio, generate_video, query_video_generation, text_to_image,
  music_generation, voice_design
- Mock api_client for all API-dependent tests
- Test success paths and error paths for each tool
- Test both local and URL resource modes
- 48 tests covering all tools with 90% server.py coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: expand test coverage — only utils tested, server and client have zero tests

1 participant