Terminal / tests /test_telegram_benchmark_live.py
Baida07's picture
sync: 157 file da Baida98/AI@f57660fe (2026-08-15 12:26 UTC) [deploy-all] (#37)
d854724
Raw
History Blame Contribute Delete
641 Bytes
import asyncio
import unittest
from unittest.mock import AsyncMock, patch
from api.telegram_webhook import _cmd_bench
class TelegramExtendedBenchmarkTests(unittest.IsolatedAsyncioTestCase):
async def test_bench_starts_background_extended_run(self):
runner = AsyncMock()
with patch("api.benchmark_handler.run_benchmark_task", runner):
await _cmd_bench(123)
await asyncio.sleep(0)
runner.assert_awaited_once()
args, kwargs = runner.await_args
self.assertEqual(args[0], 123)
self.assertEqual(kwargs["mode"], "full")
if __name__ == "__main__":
unittest.main()