Skip to content

Commit 8e92e55

Browse files
committed
Add stage to errors in api output test
1 parent 350840a commit 8e92e55

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

tests/api/test_backups.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,11 @@ async def test_api_backup_errors(
394394
assert job["child_jobs"][1]["child_jobs"][0]["name"] == "backup_addon_save"
395395
assert job["child_jobs"][1]["child_jobs"][0]["reference"] == "local_ssh"
396396
assert job["child_jobs"][1]["child_jobs"][0]["errors"] == [
397-
{"type": "BackupError", "message": "Can't create backup for local_ssh"}
397+
{
398+
"type": "BackupError",
399+
"message": "Can't create backup for local_ssh",
400+
"stage": None,
401+
}
398402
]
399403
assert job["child_jobs"][2]["name"] == "backup_store_folders"
400404
assert job["child_jobs"][2]["reference"] == slug
@@ -425,11 +429,21 @@ async def test_api_backup_errors(
425429

426430
assert job["name"] == f"backup_manager_{backup_type}_backup"
427431
assert job["done"] is True
428-
assert job["errors"] == (
429-
err := [{"type": "HomeAssistantBackupError", "message": "Backup error"}]
430-
)
432+
assert job["errors"] == [
433+
{
434+
"type": "HomeAssistantBackupError",
435+
"message": "Backup error",
436+
"stage": "home_assistant",
437+
}
438+
]
431439
assert job["child_jobs"][0]["name"] == "backup_store_homeassistant"
432-
assert job["child_jobs"][0]["errors"] == err
440+
assert job["child_jobs"][0]["errors"] == [
441+
{
442+
"type": "HomeAssistantBackupError",
443+
"message": "Backup error",
444+
"stage": None,
445+
}
446+
]
433447
assert len(job["child_jobs"]) == 1
434448

435449

0 commit comments

Comments
 (0)