43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""Tests for scheduler helper functions.
|
|
|
|
Note: _extract_docx_paths was removed as part of KV store elimination.
|
|
The scheduler no longer handles docx extraction — tools own their own sync.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
class TestLoopTimestamps:
|
|
"""Test that loop timestamps use in-memory storage."""
|
|
|
|
def test_initial_timestamps_are_none(self):
|
|
from unittest.mock import MagicMock
|
|
|
|
from cheddahbot.scheduler import Scheduler
|
|
|
|
config = MagicMock()
|
|
db = MagicMock()
|
|
agent = MagicMock()
|
|
sched = Scheduler(config, db, agent)
|
|
|
|
timestamps = sched.get_loop_timestamps()
|
|
assert timestamps["heartbeat"] is None
|
|
assert timestamps["poll"] is None
|
|
assert timestamps["clickup"] is None
|
|
|
|
def test_timestamps_update_in_memory(self):
|
|
from unittest.mock import MagicMock
|
|
|
|
from cheddahbot.scheduler import Scheduler
|
|
|
|
config = MagicMock()
|
|
db = MagicMock()
|
|
agent = MagicMock()
|
|
sched = Scheduler(config, db, agent)
|
|
|
|
sched._loop_timestamps["heartbeat"] = "2026-02-27T12:00:00+00:00"
|
|
timestamps = sched.get_loop_timestamps()
|
|
assert timestamps["heartbeat"] == "2026-02-27T12:00:00+00:00"
|
|
# Ensure db.kv_set was never called
|
|
db.kv_set.assert_not_called()
|