(refactor) Remove YAML config import and export path
Drop the pre-Django YAML import/export management commands and remove the file-based config loader fallback from the backup and retention engines. Keep the runtime config bridge backed by Django models, and add tests that ensure engine operations require an explicit Django config source.
This commit is contained in:
@@ -7,6 +7,7 @@ from unittest.mock import patch
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
from pobsync.commands.run_scheduled import run_scheduled
|
||||
from pobsync.errors import ConfigError
|
||||
from pobsync.rsync import RsyncResult
|
||||
|
||||
|
||||
@@ -34,6 +35,10 @@ class FakeConfigSource:
|
||||
|
||||
|
||||
class RunScheduledConfigSourceTests(SimpleTestCase):
|
||||
def test_requires_explicit_config_source(self) -> None:
|
||||
with self.assertRaisesMessage(ConfigError, "A Django config source is required."):
|
||||
run_scheduled(prefix=Path("/missing-prefix"), host="web-01", dry_run=True)
|
||||
|
||||
def test_dry_run_uses_injected_config_source(self) -> None:
|
||||
with patch("pobsync.commands.run_scheduled.run_rsync") as run_rsync:
|
||||
run_rsync.return_value = RsyncResult(exit_code=0, command=["rsync", "--archive"])
|
||||
|
||||
Reference in New Issue
Block a user