prole/tests/installer/test_registry_rescan_after_init.py
chrisfu 4ee2b259c9 Checkpoint: rename installer to knoe + harden db build context
- Add build-context helper to copy Docker context safely (ignore runtime data, keep symlinks)

- Update UI and core actions to use ~/.prole/build and shared copy helper

- Add/adjust tests and scripts; introduce knoe ops helpers and update manifests

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-22 01:45:21 -07:00

31 lines
951 B
Python

from __future__ import annotations
from unittest.mock import MagicMock
def test_db_rescan_registry_status_after_init_schedules_multiple_checks():
from knoe.ui.screens.database import DatabaseScreenMixin
class _Dummy(DatabaseScreenMixin):
def __init__(self):
self._scheduled: list[int] = []
self._ensure_called = 0
self._db_registry_status_label = 1
self.bg_canvas = MagicMock()
def safe_after(self, fn, delay: int = 0):
self._scheduled.append(delay)
if delay == 0:
return fn()
return None
def _ensure_db_build_registry_async(self):
self._ensure_called += 1
d = _Dummy()
d._db_rescan_registry_status_after_init()
# One immediate label update (delay 0), then a sequence of scheduled checks.
assert d._scheduled == [0, 0, 1000, 2000, 4000, 8000, 15000]
assert d._ensure_called == 1