Initial public ModelForge release
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import asyncio
|
||||
|
||||
from modelforge_api.services.hardware_polling import HardwarePollingService
|
||||
from modelforge_api.settings import Settings
|
||||
|
||||
|
||||
def test_polling_collects_once_and_stops_cleanly(monkeypatch) -> None:
|
||||
polling = HardwarePollingService(Settings(hardware_poll_interval_seconds=5))
|
||||
calls = 0
|
||||
|
||||
def refresh_once() -> None:
|
||||
nonlocal calls
|
||||
calls += 1
|
||||
polling.stop()
|
||||
|
||||
monkeypatch.setattr(polling, "_refresh_once", refresh_once)
|
||||
asyncio.run(polling.run())
|
||||
assert calls == 1
|
||||
Reference in New Issue
Block a user