Skip to content

test: unit tests for helpers (openai_compatible_helpers, async_helpers) #815

@planetf1

Description

@planetf1

Add unit tests for the helpers module — 77% overall but with critical gaps in code used by every OpenAI-compatible backend.

Scope

File Coverage What's missing Est. tests
openai_compatible_helpers.py ~12% extract_model_tool_requests(), chat_completion_delta_merge(), message_to_openai_message() — all pure functions, zero tests ~15
async_helpers.py ~28% send_to_queue(), wait_for_all_mots() — needs async fixtures/mocks ~6
server_type.py ~46% _server_type() — pure URL parsing, trivial ~3

event_loop_helper.py is at ~52% and the untested paths are complex error-handling branches — lower priority.

Notes

  • openai_compatible_helpers.py is the headline — three pure functions on the critical path for all OpenAI/Ollama/LiteLLM backends, completely untested at unit level
  • chat_completion_delta_merge() merges streaming chunks — good candidate for canned data testing
  • Part of test: improve test coverage across formatters and core #813

~24 tests, single coherent module.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions