mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2025-12-29 11:43:17 +00:00
- read databases.csv with stable types (dtype=str, keep_default_na=False) - validate database field: require '*' or concrete name (no empty/NaN) - support Postgres cluster dumps via '*' entries (pg_dumpall) - write SQL dumps atomically to avoid partial/empty files - early-skip fully ignored volumes before creating backup directories - update seed CLI to enforce new contract and update by (instance,database) - adjust tests: sql dir naming + add E2E coverage for early-skip and '*' seeding
30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
import unittest
|
|
|
|
from .helpers import run
|
|
|
|
|
|
class TestE2ECLIContractDumpOnlySql(unittest.TestCase):
|
|
def test_help_mentions_new_flag(self) -> None:
|
|
cp = run(["baudolo", "--help"], capture=True, check=True)
|
|
out = (cp.stdout or "") + "\n" + (cp.stderr or "")
|
|
self.assertIn(
|
|
"--dump-only-sql",
|
|
out,
|
|
f"Expected '--dump-only-sql' to appear in --help output. Output:\n{out}",
|
|
)
|
|
|
|
def test_old_flag_is_rejected(self) -> None:
|
|
cp = run(["baudolo", "--dump-only"], capture=True, check=False)
|
|
self.assertEqual(
|
|
cp.returncode,
|
|
2,
|
|
f"Expected exitcode 2 for unknown args, got {cp.returncode}\n"
|
|
f"STDOUT={cp.stdout}\nSTDERR={cp.stderr}",
|
|
)
|
|
err = (cp.stderr or "") + "\n" + (cp.stdout or "")
|
|
# Argparse typically prints "unrecognized arguments"
|
|
self.assertTrue(
|
|
("unrecognized arguments" in err) or ("usage:" in err.lower()),
|
|
f"Expected argparse-style error output. Output:\n{err}",
|
|
)
|