test(cli): clean up supervise test naming
test / unit (pull_request) Successful in 40s
test / integration (pull_request) Successful in 48s

This commit is contained in:
2026-06-03 17:26:15 +00:00
parent c0e1f5fd70
commit 63a7e63ce9
4 changed files with 107 additions and 112 deletions
+8 -8
View File
@@ -6,33 +6,33 @@ highlight window?`"""
import unittest
from bot_bottle.cli import supervise as dashboard
from bot_bottle.cli import supervise as supervise_cli
class TestIsRecent(unittest.TestCase):
def test_just_seen_is_recent(self):
self.assertTrue(dashboard._is_recent("p1", {"p1": 100.0}, now=100.5))
self.assertTrue(supervise_cli._is_recent("p1", {"p1": 100.0}, now=100.5))
def test_seen_within_window(self):
# Default window is 5s.
self.assertTrue(
dashboard._is_recent("p1", {"p1": 100.0}, now=104.9),
supervise_cli._is_recent("p1", {"p1": 100.0}, now=104.9),
)
def test_seen_past_window_is_not_recent(self):
self.assertFalse(
dashboard._is_recent("p1", {"p1": 100.0}, now=106.0),
supervise_cli._is_recent("p1", {"p1": 100.0}, now=106.0),
)
def test_unknown_proposal_is_not_recent(self):
self.assertFalse(
dashboard._is_recent("p2", {"p1": 100.0}, now=100.5),
supervise_cli._is_recent("p2", {"p1": 100.0}, now=100.5),
)
def test_none_args_safe_default(self):
self.assertFalse(dashboard._is_recent("p1", None, None))
self.assertFalse(dashboard._is_recent("p1", {"p1": 100.0}, None))
self.assertFalse(dashboard._is_recent("p1", None, 100.5))
self.assertFalse(supervise_cli._is_recent("p1", None, None))
self.assertFalse(supervise_cli._is_recent("p1", {"p1": 100.0}, None))
self.assertFalse(supervise_cli._is_recent("p1", None, 100.5))
if __name__ == "__main__":