Fix logic in backup retention filter (#133654)

This commit is contained in:
Erik Montnemery
2024-12-20 15:19:57 +01:00
committed by GitHub
parent 9f43a7a17b
commit 10478f4ca5
2 changed files with 30 additions and 1 deletions

View File

@@ -1331,6 +1331,35 @@ async def test_config_schedule_logic(
0,
[],
),
(
{
"type": "backup/config/update",
"create_backup": {"agent_ids": ["test.test-agent"]},
"retention": {"copies": 3, "days": None},
"schedule": "daily",
},
{
"backup-1": MagicMock(
date="2024-11-10T04:45:00+01:00",
with_automatic_settings=True,
spec=ManagerBackup,
),
"backup-2": MagicMock(
date="2024-11-11T04:45:00+01:00",
with_automatic_settings=True,
spec=ManagerBackup,
),
},
{},
{},
"2024-11-11T04:45:00+01:00",
"2024-11-12T04:45:00+01:00",
"2024-11-12T04:45:00+01:00",
1,
1,
0,
[],
),
(
{
"type": "backup/config/update",