From cd8ed8bc5793985df2c1692072a932ceee517b95 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 8 Jul 2026 02:13:35 +0200 Subject: OPEN THE RUST GATES Signed-off-by: salmonik --- tests/cogs/test_cron_integration.py | 39 ------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 tests/cogs/test_cron_integration.py (limited to 'tests/cogs/test_cron_integration.py') diff --git a/tests/cogs/test_cron_integration.py b/tests/cogs/test_cron_integration.py deleted file mode 100644 index f56fc46..0000000 --- a/tests/cogs/test_cron_integration.py +++ /dev/null @@ -1,39 +0,0 @@ -import pytest -import time -from unittest.mock import MagicMock, AsyncMock, patch - - -@pytest.fixture -def cron_cog(bot): - # Patch create_task to prevent background task creation - with patch.object(bot.loop, 'create_task', return_value=MagicMock()): - from cogs.cron import Cron - cog = Cron(bot) - yield cog - - -@pytest.mark.slow -@pytest.mark.asyncio -async def test_cron_job_execution(cron_cog): - """Test cron job executes when due.""" - cog = cron_cog - - job = { - "id": "test_job", - "cron_expression": "* * * * *", - "type": "message", - "channel_id": 456, - "active": True, - "message": "Test", - } - cog.scheduled_tasks.append(job) - - # Mock the execute_task method - with patch.object(cog, 'execute_task', new_callable=AsyncMock) as mock_exec: - # Mock should_run_task to return True - with patch.object(cog, 'should_run_task', return_value=True): - # Test single iteration of schedule_checker logic - for task in cog.scheduled_tasks: - if task.get("active", True) and cog.should_run_task(task, None): - await cog.execute_task(task) - mock_exec.assert_called_once_with(job) \ No newline at end of file -- cgit v1.2.3