Files
devdash-cli/tests/test_config.py
7000pctAUTO b21850572b
Some checks failed
CI / test (push) Has been cancelled
Initial upload: DevDash CLI with TUI dashboard
2026-02-01 06:53:05 +00:00

30 lines
1007 B
Python

import pytest
import tempfile
import os
from pathlib import Path
from src.config.config_manager import ConfigManager
from src.config.settings import Settings
class TestConfigManager:
def test_load_config_default(self, tmp_path, monkeypatch):
config_file = tmp_path / "config.json"
monkeypatch.setenv("DEVDASH_CONFIG", str(config_file))
manager = ConfigManager()
config = manager.load_config()
assert config.refresh_interval == 30
assert config.theme == "dark"
def test_save_and_load_config(self, tmp_path, monkeypatch):
config_file = tmp_path / "config.json"
monkeypatch.setenv("DEVDASH_CONFIG", str(config_file))
manager = ConfigManager()
settings = Settings(
github_token="test_token",
refresh_interval=60,
)
manager.save_config(settings)
loaded = manager.load_config()
assert loaded.github_token == "test_token"
assert loaded.refresh_interval == 60