- Replace hardcoded CONFIG_PATH with appdirs AppDirs (use app.user_config_dir) and update SETTINGS_PATH - Rework dataclasses: add Library, QbitTorrent; convert Komga.libraries to List[Library]; use Path for media_path; add getLibraryByName and proper __post_init__ conversions - Extend KomGrabber to support downloader/downloader_settings (aria2/qbit), normalize Path handling and expanduser usage - Add type fixes, utility methods (getattr/_setattr) and API __post_init__ to convert nested dicts to dataclass instances - Add package CLI entrypoints (__main__.py, src package main) and simple runner (main.py) - Add tests for package __init__ CLI and config behavior (tests/*) and a small test script (test.py) - Add .vscode/settings.json for pytest integration - Tidy pyproject.toml: format dependencies, add dev/test dependency groups and fix trailing newline in bumpversion section
19 lines
323 B
Python
19 lines
323 B
Python
from komconfig import KomConfig
|
|
import pytest
|
|
|
|
|
|
@pytest.fixture
|
|
def komconfig():
|
|
return KomConfig()
|
|
|
|
|
|
def test_komconfig(komconfig):
|
|
assert komconfig is not None
|
|
|
|
|
|
def test_general(komconfig):
|
|
assert KomConfig().general.log_file == "/var/log/komgrabber.log"
|
|
assert KomConfig().general.log_level == "INFO"
|
|
|
|
|