Initial release with Gitea updater
This commit is contained in:
commit
46c2474985
36 files changed
+3674
No files matched your search
@@ -0,0 +1,30 @@
|
||||
from pathlib import Path
|
||||
|
||||
from syncvito.config_store import ConfigStore
|
||||
from syncvito.models import AppConfig, AppSettings, SyncDirection, SyncTask
|
||||
|
||||
|
||||
def test_config_roundtrip(tmp_path: Path) -> None:
|
||||
path = tmp_path / "config.json"
|
||||
config = AppConfig(
|
||||
tasks=[
|
||||
SyncTask(
|
||||
name="Archiv",
|
||||
source=str(tmp_path / "quelle"),
|
||||
target=str(tmp_path / "ziel"),
|
||||
direction=SyncDirection.BIDIRECTIONAL,
|
||||
selected_paths=["Dokumente"],
|
||||
)
|
||||
],
|
||||
settings=AppSettings(font_size=12, ui_scale=110, check_updates_on_start=False),
|
||||
)
|
||||
ConfigStore(path).save(config)
|
||||
|
||||
loaded = ConfigStore(path).load()
|
||||
|
||||
assert loaded.settings.font_size == 12
|
||||
assert loaded.settings.ui_scale == 110
|
||||
assert loaded.settings.check_updates_on_start is False
|
||||
assert loaded.tasks[0].name == "Archiv"
|
||||
assert loaded.tasks[0].direction is SyncDirection.BIDIRECTIONAL
|
||||
assert loaded.tasks[0].selected_paths == ["Dokumente"]
|
||||
Reference in new issue
Block a user