Files
SyncGames/agent/tests/test_config_io.py
T
DawnsorrowandCursor 0d6b0b2f80 Initial SyncGames tree: agent, Android, deploy, docs.
Session-gated MinIO save sync with AppImage GUI, CLI edit/session flow, and Gitea release helper.

Co-authored-by: Cursor <[email protected]>
2026-07-14 22:06:36 -05:00

25 lines
754 B
Python

from __future__ import annotations
from pathlib import Path
from syncgames.config import AgentConfig, save_agent_config, try_load_agent_config
def test_save_and_reload_agent(tmp_path: Path, monkeypatch):
monkeypatch.setenv("SYNCGAMES_CONFIG", str(tmp_path))
cfg = AgentConfig(
device_id="laptop",
endpoint_url="https://syncgames-s3.example.com",
bucket="syncgames",
access_key="ak",
secret_key="sk",
config_root=tmp_path,
)
path = save_agent_config(cfg)
assert path.exists()
loaded = try_load_agent_config(tmp_path)
assert loaded is not None
assert loaded.device_id == "laptop"
assert loaded.endpoint_url.endswith("example.com")
assert loaded.secret_key == "sk"