fix: invoke actual cog callback in test_error_handling_and_logging (#39) #54

Merged
cal merged 1 commits from ai/paper-dynasty-discord-39 into next-release 2026-03-07 07:41:29 +00:00

1 Commits

Author SHA1 Message Date
Cal Corum
7b76b429a8 fix: invoke actual cog callback in test_error_handling_and_logging (#39)
The previous test patched api_calls.db_get and pygsheets.authorize then
called those mocks directly—never invoking any cog method. The test
passed even when all cog code was deleted.

Replace with a test that retrieves the real pull_roster_command.callback
from the cog instance, patches dependencies at the correct module-level
names, calls the callback, and asserts ctx.send was called with the
expected error message. If the cog cannot be imported, the test skips
gracefully via pytest.skip.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 01:33:09 -06:00