mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-17 13:08:19 -04:00
Add comprehensive test suite achieving 99% code coverage
Added 35 test files with 502 tests covering all Python modules including API routes, ORM models, splendor game logic/TUI, heater controller, weather service, NixOS installer, ZFS dataset management, and utilities. Coverage improved from 11% to 99% (2540/2564 statements covered). https://claude.ai/code/session_01SVzgLDUS1Cdc4eh1ijETTh
This commit is contained in:
28
tests/test_van_weather_main.py
Normal file
28
tests/test_van_weather_main.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""Tests for van_weather/main.py main() function."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from python.van_weather.main import main
|
||||
|
||||
|
||||
def test_van_weather_main() -> None:
|
||||
"""Test main sets up scheduler."""
|
||||
with (
|
||||
patch("python.van_weather.main.BlockingScheduler") as mock_sched_cls,
|
||||
patch("python.van_weather.main.configure_logger"),
|
||||
):
|
||||
mock_sched = MagicMock()
|
||||
mock_sched_cls.return_value = mock_sched
|
||||
|
||||
main(
|
||||
ha_url="http://ha.local",
|
||||
ha_token="token",
|
||||
api_key="key",
|
||||
interval=60,
|
||||
log_level="INFO",
|
||||
)
|
||||
|
||||
mock_sched.add_job.assert_called_once()
|
||||
mock_sched.start.assert_called_once()
|
||||
Reference in New Issue
Block a user