Initial upload: DevDash CLI with TUI dashboard
Some checks failed
CI / test (push) Has been cancelled
Some checks failed
CI / test (push) Has been cancelled
This commit is contained in:
29
tests/test_config.py
Normal file
29
tests/test_config.py
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
||||
Reference in New Issue
Block a user