From 97b219a43558aef9571d35b4d0983edc7c189878 Mon Sep 17 00:00:00 2001 From: Mike Degatano Date: Thu, 21 Nov 2024 21:59:10 +0000 Subject: [PATCH] Add test for partial reload no file failure --- tests/api/test_backups.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/api/test_backups.py b/tests/api/test_backups.py index 1aca0c1c8e4..f87415a5a76 100644 --- a/tests/api/test_backups.py +++ b/tests/api/test_backups.py @@ -588,3 +588,15 @@ async def test_cloud_backup_core_only(api_client: TestClient, mock_full_backup: resp = await api_client.delete(f"/backups/{mock_full_backup.slug}") assert resp.status == 403 + + +async def test_partial_reload_errors_no_file( + api_client: TestClient, + coresys: CoreSys, + tmp_supervisor_data: Path, +): + """Partial reload returns error when asked to reload non-existent file.""" + resp = await api_client.post( + "/backups/reload", json={"location": None, "filename": "does_not_exist.tar"} + ) + assert resp.status == 400