Skip to content

test(mcp): cover invalid ISO datetime paths for list_audit_logs#933

Merged
Kohei-Wada merged 1 commit into
mainfrom
test/mcp-audit-invalid-datetime-878
May 31, 2026
Merged

test(mcp): cover invalid ISO datetime paths for list_audit_logs#933
Kohei-Wada merged 1 commit into
mainfrom
test/mcp-audit-invalid-datetime-878

Conversation

@Kohei-Wada
Copy link
Copy Markdown
Owner

Summary

list_audit_logs raises a custom ValueError when since or until is not a valid ISO datetime, but those two except ValueError branches were the only uncovered code in task_audit.py.

Added a parametrized test (mirroring the existing test_optimize_schedule_invalid_datetime / test_fix_actual_times_invalid_datetime patterns) covering invalid since and until values.

Test plan

cd packages/taskdog-mcp
PYTHONPATH=src uv run python -m pytest --cov=taskdog_mcp --cov-report=term-missing
  • task_audit.py: 82% → 100%
  • Full MCP suite: 88 passed

Closes #878

Add a parametrized test asserting list_audit_logs raises ValueError when
'since' or 'until' is not a valid ISO datetime. These were the only
uncovered branches in task_audit.py (82% -> 100%).

Closes #878
Copy link
Copy Markdown

@amazon-q-developer amazon-q-developer Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds comprehensive test coverage for invalid datetime handling in list_audit_logs, bringing task_audit.py to 100% coverage. The parametrized test follows existing patterns and correctly validates error handling for both since and until parameters. The implementation is sound with no blocking issues identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@Kohei-Wada Kohei-Wada merged commit ec92842 into main May 31, 2026
15 checks passed
@Kohei-Wada Kohei-Wada deleted the test/mcp-audit-invalid-datetime-878 branch May 31, 2026 04:22
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(mcp): cover invalid ISO datetime paths for list_audit_logs

1 participant