roughly working again, now dev docker exists
This commit is contained in:
parent
a77a0c0393
commit
155ab39368
26 changed files with 1976 additions and 235 deletions
29
tests/test_state_manager.py
Normal file
29
tests/test_state_manager.py
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue