21 lines
719 B
Python
21 lines
719 B
Python
from pathlib import Path
|
|
|
|
|
|
def test_restore_postgres_plan_is_non_destructive():
|
|
script = Path("scripts/restore_postgres_plan.sh").read_text(encoding="utf-8")
|
|
executable_prefix = script.split("cat <<EOF", 1)[0]
|
|
|
|
assert "pg_restore" in script
|
|
assert "This script intentionally does not execute restore automatically." in script
|
|
assert "pg_restore" not in executable_prefix
|
|
|
|
|
|
def test_backup_postgres_writes_manifest_and_version():
|
|
script = Path("scripts/backup_postgres.sh").read_text(encoding="utf-8")
|
|
|
|
assert "pg_dump" in script
|
|
assert "alembic_version.txt" in script
|
|
assert "manifest.txt" in script
|
|
assert "test -s" not in script
|
|
assert 'if [ ! -s "$DUMP_PATH" ]' in script
|