Files
dotfiles/tests/test_van_weather_main.py
Claude b3199dfc31 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
2026-03-09 03:55:38 +00:00

29 lines
760 B
Python

"""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()