mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-10 23:15:37 +08:00
tests: Reduce backup surface for tests
This commit is contained in:
parent
c3ababae05
commit
5a2c69013f
1 changed files with 10 additions and 2 deletions
|
@ -186,9 +186,17 @@ def test_real_restic_output():
|
|||
exit_code, output = command_runner(
|
||||
f"{restic_binary} init --repository-version 2", live_output=True
|
||||
)
|
||||
# Just backend current directory
|
||||
cmd = f"{restic_binary} backup {api_arg} {Path(BASEDIR).joinpath('npbackup')}"
|
||||
assert exit_code == 0, "Cannot init repo"
|
||||
# Just backup current npbackup project
|
||||
|
||||
cmd = f"{restic_binary} backup {BASEDIR} {api_arg}"
|
||||
exit_code, output = command_runner(cmd, timeout=600, live_output=True)
|
||||
print("cmd", cmd)
|
||||
print("OUTPUT", output)
|
||||
try:
|
||||
repo_path.unlink()
|
||||
except OSError as exc:
|
||||
print(f"CANNOT REMOVE test repo: {exc}")
|
||||
assert exit_code == 0, "Failed to run restic"
|
||||
if not api_arg:
|
||||
restic_json = restic_str_output_to_json(True, output)
|
||||
|
|
Loading…
Add table
Reference in a new issue