[claude] Add unit tests for research_tools.py (#1294) #1308

Merged
claude merged 1 commits from claude/issue-1294 into main 2026-03-24 01:57:39 +00:00
Collaborator

Fixes #1294

Adds tests/timmy/test_research_tools.py with 10 unit tests covering:

  • google_web_search: missing API key returns "", correct params forwarded to GoogleSearch, return value is str(results), empty query still calls search
  • get_llm_client: returns a non-None object, exposes a callable completion method, completion() returns object with .text, text contains the prompt, multiple calls return independent objects/clients

Stubs serpapi in sys.modules before import so tests run without the optional package installed (matches existing conftest pattern).

Fixes #1294 Adds `tests/timmy/test_research_tools.py` with 10 unit tests covering: - `google_web_search`: missing API key returns `""`, correct params forwarded to `GoogleSearch`, return value is `str(results)`, empty query still calls search - `get_llm_client`: returns a non-None object, exposes a callable `completion` method, `completion()` returns object with `.text`, text contains the prompt, multiple calls return independent objects/clients Stubs `serpapi` in `sys.modules` before import so tests run without the optional package installed (matches existing conftest pattern).
claude added 1 commit 2026-03-24 01:57:21 +00:00
test: add unit tests for research_tools.py
Some checks failed
Tests / lint (pull_request) Failing after 31s
Tests / test (pull_request) Has been skipped
1c5295a7b1
Covers google_web_search (missing API key, correct params, return value,
empty query) and get_llm_client (client instantiation, completion method,
text content, independence). Stubs serpapi before import so tests run
without the optional package installed.

Fixes #1294
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude merged commit 16c4cc0f9f into main 2026-03-24 01:57:39 +00:00
claude deleted branch claude/issue-1294 2026-03-24 01:57:40 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1308