[claude] Add unit tests for tools/system_tools.py (#1345) #1354

Merged
claude merged 1 commits from claude/issue-1345 into main 2026-03-24 02:56:35 +00:00
Collaborator

Fixes #1345

Creates tests/timmy/test_system_tools.py with 67 unit tests covering all core functions in src/timmy/tools/system_tools.py:

  • _safe_eval: constants, arithmetic ops, math functions/attributes, injection prevention (strings, unknown names, unsupported ops/syntax)
  • calculator: basic operations, error handling, injection prevention
  • consult_grok: unavailable path, free mode, spark logging failures, paid mode lightning failures
  • web_fetch: URL validation, missing packages, truncation, HTTP errors, timeout, request exceptions
  • AiderTool: success/failure/timeout/os-error paths, model/flag/cwd arg validation
  • Toolkit factories (create_code_tools, create_security_tools, create_devops_tools): ImportError paths and happy paths

All tests pass tox -e unit (821 passed, 3 skipped).

Fixes #1345 Creates `tests/timmy/test_system_tools.py` with 67 unit tests covering all core functions in `src/timmy/tools/system_tools.py`: - **`_safe_eval`**: constants, arithmetic ops, math functions/attributes, injection prevention (strings, unknown names, unsupported ops/syntax) - **`calculator`**: basic operations, error handling, injection prevention - **`consult_grok`**: unavailable path, free mode, spark logging failures, paid mode lightning failures - **`web_fetch`**: URL validation, missing packages, truncation, HTTP errors, timeout, request exceptions - **`AiderTool`**: success/failure/timeout/os-error paths, model/flag/cwd arg validation - **Toolkit factories** (`create_code_tools`, `create_security_tools`, `create_devops_tools`): ImportError paths and happy paths All tests pass `tox -e unit` (821 passed, 3 skipped).
claude added 1 commit 2026-03-24 02:56:15 +00:00
test: add unit tests for tools/system_tools.py
Some checks failed
Tests / lint (pull_request) Failing after 31s
Tests / test (pull_request) Has been skipped
5251dda8e7
Creates tests/timmy/test_system_tools.py with 67 tests covering:
- _safe_eval: constants, arithmetic ops, math functions, injection
  prevention, unsupported syntax
- calculator: basic operations, error handling, injection prevention
- consult_grok: unavailable path, free mode, spark logging failures,
  paid mode lightning failures
- web_fetch: URL validation, missing packages, truncation, HTTP errors,
  timeout, request exceptions
- AiderTool: success/failure/timeout/os-error paths, model/flag/cwd
  args validation
- toolkit factories: ImportError paths and happy paths for code/security/devops

Fixes #1345

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude merged commit 36f3f1b3a7 into main 2026-03-24 02:56:35 +00:00
claude deleted branch claude/issue-1345 2026-03-24 02:56:36 +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#1354