mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 10:15:21 +00:00
fix: say why backup and restore do not apply to a native install
Both accepted a native install and then drove `docker compose` in a directory with no compose file, so the user got "no configuration file provided" rather than an explanation. They now refuse with what to do instead, and restore refuses before it reads the archive or stops anything.
This commit is contained in:
1 parent
61f06fcce8
commit
501baf8aae
2 files changed
+20
-1
No files matched your search
@@ -238,6 +238,17 @@ class TestNativeLifecycle:
|
||||
self._installed(tmp_path, FakeServices())
|
||||
assert _run(["logs", "--dir", str(tmp_path)], _native_context()) == 0, "logs work in both modes"
|
||||
|
||||
def test_backup_says_why_there_is_nothing_to_archive(self, tmp_path):
|
||||
"""Its data is not in Docker volumes, so compose would fail with no configuration file."""
|
||||
self._installed(tmp_path, FakeServices())
|
||||
with pytest.raises(DeployError, match="native install"):
|
||||
_run(["backup", "--dir", str(tmp_path)], _native_context())
|
||||
|
||||
def test_restore_refuses_before_it_touches_anything(self, tmp_path):
|
||||
self._installed(tmp_path, FakeServices())
|
||||
with pytest.raises(DeployError, match="native install"):
|
||||
_run(["restore", str(tmp_path / "any.tar.gz"), "--dir", str(tmp_path), "--yes"], _native_context())
|
||||
|
||||
|
||||
class FakeLaunchctl:
|
||||
"""launchctl, with a bootout that takes `unload_polls` polls to take effect."""
|
||||
|
||||
Reference in new issue
Block a user