roughly working again, now dev docker exists

This commit is contained in:
Aron Petau 2025-12-28 19:59:31 +01:00
parent a77a0c0393
commit 155ab39368
26 changed files with 1976 additions and 235 deletions

View file

@ -0,0 +1,29 @@
import pytest
from pathlib import Path
from state_manager import StateManager
import json
@pytest.fixture
def state_file(tmp_path):
return tmp_path / "state.json"
@pytest.fixture
def state_manager(state_file):
return StateManager(state_file)
def test_load_state_default(state_manager):
state = state_manager.load_state()
assert state == {"autopilot": False}
def test_save_state(state_manager):
state = {"autopilot": True}
state_manager.save_state(state)
loaded_state = state_manager.load_state()
assert loaded_state == state
def test_set_autopilot(state_manager):
state_manager.set_autopilot(True)
assert state_manager.is_autopilot_enabled() is True
state_manager.set_autopilot(False)
assert state_manager.is_autopilot_enabled() is False