Added automatic nightly SQLite backups

Resolves #22
This commit is contained in:
Donkie
2023-07-04 14:59:05 +02:00
parent 51783afe92
commit f24b9610e8
13 changed files with 221 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
"""Integration tests for the Vendor API endpoint."""
import httpx
from .conftest import DbType, get_db_type
URL = "http://spoolman:8000"
def test_backup():
"""Test triggering an automatic database backup."""
if get_db_type() != DbType.SQLITE:
return
# Trigger backup
result = httpx.post(f"{URL}/api/v1/backup")
result.raise_for_status()
assert result.json()["success"] is True