mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Rename strategy backup to automatic backup (#133489)
* Rename strategy backup to automatic backup * Update homeassistant/components/backup/config.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
a1558213c4
commit
5516f3609d
@ -33,8 +33,8 @@ class StoredBackupConfig(TypedDict):
|
||||
"""Represent the stored backup config."""
|
||||
|
||||
create_backup: StoredCreateBackupConfig
|
||||
last_attempted_strategy_backup: str | None
|
||||
last_completed_strategy_backup: str | None
|
||||
last_attempted_automatic_backup: str | None
|
||||
last_completed_automatic_backup: str | None
|
||||
retention: StoredRetentionConfig
|
||||
schedule: StoredBackupSchedule
|
||||
|
||||
@ -44,8 +44,8 @@ class BackupConfigData:
|
||||
"""Represent loaded backup config data."""
|
||||
|
||||
create_backup: CreateBackupConfig
|
||||
last_attempted_strategy_backup: datetime | None = None
|
||||
last_completed_strategy_backup: datetime | None = None
|
||||
last_attempted_automatic_backup: datetime | None = None
|
||||
last_completed_automatic_backup: datetime | None = None
|
||||
retention: RetentionConfig
|
||||
schedule: BackupSchedule
|
||||
|
||||
@ -59,12 +59,12 @@ class BackupConfigData:
|
||||
include_folders = None
|
||||
retention = data["retention"]
|
||||
|
||||
if last_attempted_str := data["last_attempted_strategy_backup"]:
|
||||
if last_attempted_str := data["last_attempted_automatic_backup"]:
|
||||
last_attempted = dt_util.parse_datetime(last_attempted_str)
|
||||
else:
|
||||
last_attempted = None
|
||||
|
||||
if last_attempted_str := data["last_completed_strategy_backup"]:
|
||||
if last_attempted_str := data["last_completed_automatic_backup"]:
|
||||
last_completed = dt_util.parse_datetime(last_attempted_str)
|
||||
else:
|
||||
last_completed = None
|
||||
@ -79,8 +79,8 @@ class BackupConfigData:
|
||||
name=data["create_backup"]["name"],
|
||||
password=data["create_backup"]["password"],
|
||||
),
|
||||
last_attempted_strategy_backup=last_attempted,
|
||||
last_completed_strategy_backup=last_completed,
|
||||
last_attempted_automatic_backup=last_attempted,
|
||||
last_completed_automatic_backup=last_completed,
|
||||
retention=RetentionConfig(
|
||||
copies=retention["copies"],
|
||||
days=retention["days"],
|
||||
@ -90,20 +90,20 @@ class BackupConfigData:
|
||||
|
||||
def to_dict(self) -> StoredBackupConfig:
|
||||
"""Convert backup config data to a dict."""
|
||||
if self.last_attempted_strategy_backup:
|
||||
last_attempted = self.last_attempted_strategy_backup.isoformat()
|
||||
if self.last_attempted_automatic_backup:
|
||||
last_attempted = self.last_attempted_automatic_backup.isoformat()
|
||||
else:
|
||||
last_attempted = None
|
||||
|
||||
if self.last_completed_strategy_backup:
|
||||
last_completed = self.last_completed_strategy_backup.isoformat()
|
||||
if self.last_completed_automatic_backup:
|
||||
last_completed = self.last_completed_automatic_backup.isoformat()
|
||||
else:
|
||||
last_completed = None
|
||||
|
||||
return StoredBackupConfig(
|
||||
create_backup=self.create_backup.to_dict(),
|
||||
last_attempted_strategy_backup=last_attempted,
|
||||
last_completed_strategy_backup=last_completed,
|
||||
last_attempted_automatic_backup=last_attempted,
|
||||
last_completed_automatic_backup=last_completed,
|
||||
retention=self.retention.to_dict(),
|
||||
schedule=self.schedule.to_dict(),
|
||||
)
|
||||
@ -286,7 +286,7 @@ class BackupSchedule:
|
||||
self._unschedule_next(manager)
|
||||
now = dt_util.now()
|
||||
if (cron_event := self.cron_event) is None:
|
||||
seed_time = manager.config.data.last_completed_strategy_backup or now
|
||||
seed_time = manager.config.data.last_completed_automatic_backup or now
|
||||
cron_event = self.cron_event = CronSim(cron_pattern, seed_time)
|
||||
next_time = next(cron_event)
|
||||
|
||||
@ -316,7 +316,7 @@ class BackupSchedule:
|
||||
include_homeassistant=True, # always include HA
|
||||
name=config_data.create_backup.name,
|
||||
password=config_data.create_backup.password,
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
)
|
||||
except Exception: # noqa: BLE001
|
||||
# another more specific exception will be added
|
||||
@ -404,14 +404,14 @@ async def _delete_filtered_backups(
|
||||
get_agent_errors,
|
||||
)
|
||||
|
||||
# only delete backups that are created by the backup strategy
|
||||
# only delete backups that are created with the saved automatic settings
|
||||
backups = {
|
||||
backup_id: backup
|
||||
for backup_id, backup in backups.items()
|
||||
if backup.with_strategy_settings
|
||||
if backup.with_automatic_settings
|
||||
}
|
||||
|
||||
LOGGER.debug("Total strategy backups: %s", backups)
|
||||
LOGGER.debug("Total automatic backups: %s", backups)
|
||||
|
||||
filtered_backups = backup_filter(backups)
|
||||
|
||||
|
@ -60,7 +60,7 @@ class ManagerBackup(AgentBackup):
|
||||
|
||||
agent_ids: list[str]
|
||||
failed_agent_ids: list[str]
|
||||
with_strategy_settings: bool | None
|
||||
with_automatic_settings: bool | None
|
||||
|
||||
|
||||
@dataclass(frozen=True, kw_only=True, slots=True)
|
||||
@ -445,10 +445,10 @@ class BackupManager:
|
||||
if (backup_id := agent_backup.backup_id) not in backups:
|
||||
if known_backup := self.known_backups.get(backup_id):
|
||||
failed_agent_ids = known_backup.failed_agent_ids
|
||||
with_strategy_settings = known_backup.with_strategy_settings
|
||||
with_automatic_settings = known_backup.with_automatic_settings
|
||||
else:
|
||||
failed_agent_ids = []
|
||||
with_strategy_settings = None
|
||||
with_automatic_settings = None
|
||||
backups[backup_id] = ManagerBackup(
|
||||
agent_ids=[],
|
||||
addons=agent_backup.addons,
|
||||
@ -462,7 +462,7 @@ class BackupManager:
|
||||
name=agent_backup.name,
|
||||
protected=agent_backup.protected,
|
||||
size=agent_backup.size,
|
||||
with_strategy_settings=with_strategy_settings,
|
||||
with_automatic_settings=with_automatic_settings,
|
||||
)
|
||||
backups[backup_id].agent_ids.append(agent_ids[idx])
|
||||
|
||||
@ -494,10 +494,10 @@ class BackupManager:
|
||||
if backup is None:
|
||||
if known_backup := self.known_backups.get(backup_id):
|
||||
failed_agent_ids = known_backup.failed_agent_ids
|
||||
with_strategy_settings = known_backup.with_strategy_settings
|
||||
with_automatic_settings = known_backup.with_automatic_settings
|
||||
else:
|
||||
failed_agent_ids = []
|
||||
with_strategy_settings = None
|
||||
with_automatic_settings = None
|
||||
backup = ManagerBackup(
|
||||
agent_ids=[],
|
||||
addons=result.addons,
|
||||
@ -511,7 +511,7 @@ class BackupManager:
|
||||
name=result.name,
|
||||
protected=result.protected,
|
||||
size=result.size,
|
||||
with_strategy_settings=with_strategy_settings,
|
||||
with_automatic_settings=with_automatic_settings,
|
||||
)
|
||||
backup.agent_ids.append(agent_ids[idx])
|
||||
|
||||
@ -611,7 +611,7 @@ class BackupManager:
|
||||
include_homeassistant: bool,
|
||||
name: str | None,
|
||||
password: str | None,
|
||||
with_strategy_settings: bool = False,
|
||||
with_automatic_settings: bool = False,
|
||||
) -> NewBackup:
|
||||
"""Create a backup."""
|
||||
new_backup = await self.async_initiate_backup(
|
||||
@ -623,7 +623,7 @@ class BackupManager:
|
||||
include_homeassistant=include_homeassistant,
|
||||
name=name,
|
||||
password=password,
|
||||
with_strategy_settings=with_strategy_settings,
|
||||
with_automatic_settings=with_automatic_settings,
|
||||
)
|
||||
assert self._backup_finish_task
|
||||
await self._backup_finish_task
|
||||
@ -640,14 +640,14 @@ class BackupManager:
|
||||
include_homeassistant: bool,
|
||||
name: str | None,
|
||||
password: str | None,
|
||||
with_strategy_settings: bool = False,
|
||||
with_automatic_settings: bool = False,
|
||||
) -> NewBackup:
|
||||
"""Initiate generating a backup."""
|
||||
if self.state is not BackupManagerState.IDLE:
|
||||
raise HomeAssistantError(f"Backup manager busy: {self.state}")
|
||||
|
||||
if with_strategy_settings:
|
||||
self.config.data.last_attempted_strategy_backup = dt_util.now()
|
||||
if with_automatic_settings:
|
||||
self.config.data.last_attempted_automatic_backup = dt_util.now()
|
||||
self.store.save()
|
||||
|
||||
self.async_on_backup_event(
|
||||
@ -663,7 +663,7 @@ class BackupManager:
|
||||
include_homeassistant=include_homeassistant,
|
||||
name=name,
|
||||
password=password,
|
||||
with_strategy_settings=with_strategy_settings,
|
||||
with_automatic_settings=with_automatic_settings,
|
||||
)
|
||||
except Exception:
|
||||
self.async_on_backup_event(
|
||||
@ -683,7 +683,7 @@ class BackupManager:
|
||||
include_homeassistant: bool,
|
||||
name: str | None,
|
||||
password: str | None,
|
||||
with_strategy_settings: bool,
|
||||
with_automatic_settings: bool,
|
||||
) -> NewBackup:
|
||||
"""Initiate generating a backup."""
|
||||
if not agent_ids:
|
||||
@ -708,13 +708,13 @@ class BackupManager:
|
||||
password=password,
|
||||
)
|
||||
self._backup_finish_task = self.hass.async_create_task(
|
||||
self._async_finish_backup(agent_ids, with_strategy_settings),
|
||||
self._async_finish_backup(agent_ids, with_automatic_settings),
|
||||
name="backup_manager_finish_backup",
|
||||
)
|
||||
return new_backup
|
||||
|
||||
async def _async_finish_backup(
|
||||
self, agent_ids: list[str], with_strategy_settings: bool
|
||||
self, agent_ids: list[str], with_automatic_settings: bool
|
||||
) -> None:
|
||||
if TYPE_CHECKING:
|
||||
assert self._backup_task is not None
|
||||
@ -743,12 +743,12 @@ class BackupManager:
|
||||
open_stream=written_backup.open_stream,
|
||||
)
|
||||
await written_backup.release_stream()
|
||||
if with_strategy_settings:
|
||||
# create backup was successful, update last_completed_strategy_backup
|
||||
self.config.data.last_completed_strategy_backup = dt_util.now()
|
||||
if with_automatic_settings:
|
||||
# create backup was successful, update last_completed_automatic_backup
|
||||
self.config.data.last_completed_automatic_backup = dt_util.now()
|
||||
self.store.save()
|
||||
self.known_backups.add(
|
||||
written_backup.backup, agent_errors, with_strategy_settings
|
||||
written_backup.backup, agent_errors, with_automatic_settings
|
||||
)
|
||||
|
||||
# delete old backups more numerous than copies
|
||||
@ -870,7 +870,7 @@ class KnownBackups:
|
||||
backup["backup_id"]: KnownBackup(
|
||||
backup_id=backup["backup_id"],
|
||||
failed_agent_ids=backup["failed_agent_ids"],
|
||||
with_strategy_settings=backup["with_strategy_settings"],
|
||||
with_automatic_settings=backup["with_automatic_settings"],
|
||||
)
|
||||
for backup in stored_backups
|
||||
}
|
||||
@ -883,13 +883,13 @@ class KnownBackups:
|
||||
self,
|
||||
backup: AgentBackup,
|
||||
agent_errors: dict[str, Exception],
|
||||
with_strategy_settings: bool,
|
||||
with_automatic_settings: bool,
|
||||
) -> None:
|
||||
"""Add a backup."""
|
||||
self._backups[backup.backup_id] = KnownBackup(
|
||||
backup_id=backup.backup_id,
|
||||
failed_agent_ids=list(agent_errors),
|
||||
with_strategy_settings=with_strategy_settings,
|
||||
with_automatic_settings=with_automatic_settings,
|
||||
)
|
||||
self._manager.store.save()
|
||||
|
||||
@ -911,14 +911,14 @@ class KnownBackup:
|
||||
|
||||
backup_id: str
|
||||
failed_agent_ids: list[str]
|
||||
with_strategy_settings: bool
|
||||
with_automatic_settings: bool
|
||||
|
||||
def to_dict(self) -> StoredKnownBackup:
|
||||
"""Convert known backup to a dict."""
|
||||
return {
|
||||
"backup_id": self.backup_id,
|
||||
"failed_agent_ids": self.failed_agent_ids,
|
||||
"with_strategy_settings": self.with_strategy_settings,
|
||||
"with_automatic_settings": self.with_automatic_settings,
|
||||
}
|
||||
|
||||
|
||||
@ -927,7 +927,7 @@ class StoredKnownBackup(TypedDict):
|
||||
|
||||
backup_id: str
|
||||
failed_agent_ids: list[str]
|
||||
with_strategy_settings: bool
|
||||
with_automatic_settings: bool
|
||||
|
||||
|
||||
class CoreBackupReaderWriter(BackupReaderWriter):
|
||||
|
@ -25,7 +25,7 @@ def async_register_websocket_handlers(hass: HomeAssistant, with_hassio: bool) ->
|
||||
websocket_api.async_register_command(hass, handle_details)
|
||||
websocket_api.async_register_command(hass, handle_info)
|
||||
websocket_api.async_register_command(hass, handle_create)
|
||||
websocket_api.async_register_command(hass, handle_create_with_strategy_settings)
|
||||
websocket_api.async_register_command(hass, handle_create_with_automatic_settings)
|
||||
websocket_api.async_register_command(hass, handle_delete)
|
||||
websocket_api.async_register_command(hass, handle_restore)
|
||||
websocket_api.async_register_command(hass, handle_subscribe_events)
|
||||
@ -52,8 +52,8 @@ async def handle_info(
|
||||
agent_id: str(err) for agent_id, err in agent_errors.items()
|
||||
},
|
||||
"backups": list(backups.values()),
|
||||
"last_attempted_strategy_backup": manager.config.data.last_attempted_strategy_backup,
|
||||
"last_completed_strategy_backup": manager.config.data.last_completed_strategy_backup,
|
||||
"last_attempted_automatic_backup": manager.config.data.last_attempted_automatic_backup,
|
||||
"last_completed_automatic_backup": manager.config.data.last_completed_automatic_backup,
|
||||
},
|
||||
)
|
||||
|
||||
@ -181,11 +181,11 @@ async def handle_create(
|
||||
@websocket_api.require_admin
|
||||
@websocket_api.websocket_command(
|
||||
{
|
||||
vol.Required("type"): "backup/generate_with_strategy_settings",
|
||||
vol.Required("type"): "backup/generate_with_automatic_settings",
|
||||
}
|
||||
)
|
||||
@websocket_api.async_response
|
||||
async def handle_create_with_strategy_settings(
|
||||
async def handle_create_with_automatic_settings(
|
||||
hass: HomeAssistant,
|
||||
connection: websocket_api.ActiveConnection,
|
||||
msg: dict[str, Any],
|
||||
@ -202,7 +202,7 @@ async def handle_create_with_strategy_settings(
|
||||
include_homeassistant=True, # always include HA
|
||||
name=config_data.create_backup.name,
|
||||
password=config_data.create_backup.password,
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
)
|
||||
connection.send_result(msg["id"], backup)
|
||||
|
||||
|
@ -78,11 +78,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -110,8 +110,8 @@
|
||||
}),
|
||||
'backups': list([
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -139,8 +139,8 @@
|
||||
}),
|
||||
'backups': list([
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -168,8 +168,8 @@
|
||||
}),
|
||||
'backups': list([
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -197,8 +197,8 @@
|
||||
}),
|
||||
'backups': list([
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
|
@ -190,8 +190,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -225,8 +225,8 @@
|
||||
'name': 'test-name',
|
||||
'password': 'test-password',
|
||||
}),
|
||||
'last_attempted_strategy_backup': '2024-10-26T04:45:00+01:00',
|
||||
'last_completed_strategy_backup': '2024-10-26T04:45:00+01:00',
|
||||
'last_attempted_automatic_backup': '2024-10-26T04:45:00+01:00',
|
||||
'last_completed_automatic_backup': '2024-10-26T04:45:00+01:00',
|
||||
'retention': dict({
|
||||
'copies': 3,
|
||||
'days': 7,
|
||||
@ -256,8 +256,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': 3,
|
||||
'days': None,
|
||||
@ -287,8 +287,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': '2024-10-27T04:45:00+01:00',
|
||||
'last_completed_strategy_backup': '2024-10-26T04:45:00+01:00',
|
||||
'last_attempted_automatic_backup': '2024-10-27T04:45:00+01:00',
|
||||
'last_completed_automatic_backup': '2024-10-26T04:45:00+01:00',
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': 7,
|
||||
@ -318,8 +318,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -349,8 +349,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -379,8 +379,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -410,8 +410,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': 7,
|
||||
@ -442,8 +442,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': 7,
|
||||
@ -473,8 +473,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -504,8 +504,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': 7,
|
||||
@ -536,8 +536,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': 7,
|
||||
@ -567,8 +567,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -598,8 +598,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -630,8 +630,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -661,8 +661,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -692,8 +692,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -724,8 +724,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -755,8 +755,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -786,8 +786,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -818,8 +818,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -849,8 +849,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -884,8 +884,8 @@
|
||||
'name': 'test-name',
|
||||
'password': 'test-password',
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -920,8 +920,8 @@
|
||||
'name': 'test-name',
|
||||
'password': 'test-password',
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -951,8 +951,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -982,8 +982,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': 3,
|
||||
'days': 7,
|
||||
@ -1014,8 +1014,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': 3,
|
||||
'days': 7,
|
||||
@ -1045,8 +1045,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -1076,8 +1076,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -1108,8 +1108,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -1139,8 +1139,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -1170,8 +1170,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': 3,
|
||||
'days': None,
|
||||
@ -1202,8 +1202,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': 3,
|
||||
'days': None,
|
||||
@ -1233,8 +1233,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -1264,8 +1264,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': 7,
|
||||
@ -1296,8 +1296,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': 7,
|
||||
@ -1327,8 +1327,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -1358,8 +1358,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': 3,
|
||||
'days': None,
|
||||
@ -1390,8 +1390,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': 3,
|
||||
'days': None,
|
||||
@ -1421,8 +1421,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -1451,8 +1451,8 @@
|
||||
'name': None,
|
||||
'password': None,
|
||||
}),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
'retention': dict({
|
||||
'copies': None,
|
||||
'days': None,
|
||||
@ -1474,8 +1474,8 @@
|
||||
}),
|
||||
'backups': list([
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1500,8 +1500,8 @@
|
||||
}),
|
||||
'backups': list([
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1539,11 +1539,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1568,8 +1568,8 @@
|
||||
}),
|
||||
'backups': list([
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1607,11 +1607,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1660,11 +1660,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1697,11 +1697,11 @@
|
||||
'name': 'Test 2',
|
||||
'protected': False,
|
||||
'size': 1,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1745,11 +1745,11 @@
|
||||
'name': 'Test 2',
|
||||
'protected': False,
|
||||
'size': 1,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1788,11 +1788,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1841,11 +1841,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1895,11 +1895,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 13,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -1950,11 +1950,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 13,
|
||||
'with_strategy_settings': False,
|
||||
'with_automatic_settings': False,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2003,11 +2003,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 13,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2056,11 +2056,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 13,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2109,11 +2109,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 13,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2163,11 +2163,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 13,
|
||||
'with_strategy_settings': False,
|
||||
'with_automatic_settings': False,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2216,7 +2216,7 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
}),
|
||||
'success': True,
|
||||
@ -2254,7 +2254,7 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
}),
|
||||
'success': True,
|
||||
@ -2305,7 +2305,7 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
}),
|
||||
'success': True,
|
||||
@ -2344,7 +2344,7 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
}),
|
||||
'success': True,
|
||||
@ -2607,11 +2607,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2649,11 +2649,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2692,11 +2692,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2729,7 +2729,7 @@
|
||||
'name': 'Test 2',
|
||||
'protected': False,
|
||||
'size': 1,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
dict({
|
||||
'addons': list([
|
||||
@ -2756,11 +2756,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
@ -2799,11 +2799,11 @@
|
||||
'name': 'Test',
|
||||
'protected': False,
|
||||
'size': 0,
|
||||
'with_strategy_settings': None,
|
||||
'with_automatic_settings': None,
|
||||
}),
|
||||
]),
|
||||
'last_attempted_strategy_backup': None,
|
||||
'last_completed_strategy_backup': None,
|
||||
'last_attempted_automatic_backup': None,
|
||||
'last_completed_automatic_backup': None,
|
||||
}),
|
||||
'success': True,
|
||||
'type': 'result',
|
||||
|
@ -260,8 +260,8 @@ async def test_async_initiate_backup(
|
||||
assert result["result"] == {
|
||||
"backups": [],
|
||||
"agent_errors": {},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
}
|
||||
|
||||
await ws_client.send_json_auto_id({"type": "backup/subscribe_events"})
|
||||
@ -424,8 +424,8 @@ async def test_async_initiate_backup_with_agent_error(
|
||||
assert result["result"] == {
|
||||
"backups": [],
|
||||
"agent_errors": {},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
}
|
||||
|
||||
await ws_client.send_json_auto_id({"type": "backup/subscribe_events"})
|
||||
@ -496,7 +496,7 @@ async def test_async_initiate_backup_with_agent_error(
|
||||
"name": "Core 2025.1.0",
|
||||
"protected": False,
|
||||
"size": 123,
|
||||
"with_strategy_settings": False,
|
||||
"with_automatic_settings": False,
|
||||
}
|
||||
|
||||
await ws_client.send_json_auto_id(
|
||||
@ -513,8 +513,8 @@ async def test_async_initiate_backup_with_agent_error(
|
||||
assert result["result"] == {
|
||||
"agent_errors": {},
|
||||
"backups": [expected_backup_data],
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
}
|
||||
|
||||
await hass.async_block_till_done()
|
||||
@ -522,7 +522,7 @@ async def test_async_initiate_backup_with_agent_error(
|
||||
{
|
||||
"backup_id": "abc123",
|
||||
"failed_agent_ids": ["test.remote"],
|
||||
"with_strategy_settings": False,
|
||||
"with_automatic_settings": False,
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -55,8 +55,8 @@ DEFAULT_STORAGE_DATA: dict[str, Any] = {
|
||||
"name": None,
|
||||
"password": None,
|
||||
},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
"retention": {
|
||||
"copies": None,
|
||||
"days": None,
|
||||
@ -276,7 +276,7 @@ async def test_delete(
|
||||
{
|
||||
"backup_id": "abc123",
|
||||
"failed_agent_ids": ["test.remote"],
|
||||
"with_strategy_settings": False,
|
||||
"with_automatic_settings": False,
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -487,7 +487,7 @@ async def test_generate_calls_create(
|
||||
"include_homeassistant": True,
|
||||
"name": None,
|
||||
"password": None,
|
||||
"with_strategy_settings": True,
|
||||
"with_automatic_settings": True,
|
||||
},
|
||||
),
|
||||
(
|
||||
@ -509,7 +509,7 @@ async def test_generate_calls_create(
|
||||
"include_homeassistant": True,
|
||||
"name": "test-name",
|
||||
"password": "test-password",
|
||||
"with_strategy_settings": True,
|
||||
"with_automatic_settings": True,
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -522,7 +522,7 @@ async def test_generate_with_default_settings_calls_create(
|
||||
create_backup_settings: dict[str, Any],
|
||||
expected_call_params: dict[str, Any],
|
||||
) -> None:
|
||||
"""Test backup/generate_with_strategy_settings calls async_initiate_backup."""
|
||||
"""Test backup/generate_with_automatic_settings calls async_initiate_backup."""
|
||||
await setup_backup_integration(hass, with_hassio=False)
|
||||
|
||||
client = await hass_ws_client(hass)
|
||||
@ -540,7 +540,7 @@ async def test_generate_with_default_settings_calls_create(
|
||||
return_value=NewBackup(backup_job_id="abc123"),
|
||||
) as generate_backup:
|
||||
await client.send_json_auto_id(
|
||||
{"type": "backup/generate_with_strategy_settings"}
|
||||
{"type": "backup/generate_with_automatic_settings"}
|
||||
)
|
||||
result = await client.receive_json()
|
||||
assert result["success"]
|
||||
@ -780,8 +780,8 @@ async def test_agents_info(
|
||||
"password": "test-password",
|
||||
},
|
||||
"retention": {"copies": 3, "days": 7},
|
||||
"last_attempted_strategy_backup": "2024-10-26T04:45:00+01:00",
|
||||
"last_completed_strategy_backup": "2024-10-26T04:45:00+01:00",
|
||||
"last_attempted_automatic_backup": "2024-10-26T04:45:00+01:00",
|
||||
"last_completed_automatic_backup": "2024-10-26T04:45:00+01:00",
|
||||
"schedule": {"state": "daily"},
|
||||
},
|
||||
},
|
||||
@ -798,8 +798,8 @@ async def test_agents_info(
|
||||
"password": None,
|
||||
},
|
||||
"retention": {"copies": 3, "days": None},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
"schedule": {"state": "never"},
|
||||
},
|
||||
},
|
||||
@ -816,8 +816,8 @@ async def test_agents_info(
|
||||
"password": None,
|
||||
},
|
||||
"retention": {"copies": None, "days": 7},
|
||||
"last_attempted_strategy_backup": "2024-10-27T04:45:00+01:00",
|
||||
"last_completed_strategy_backup": "2024-10-26T04:45:00+01:00",
|
||||
"last_attempted_automatic_backup": "2024-10-27T04:45:00+01:00",
|
||||
"last_completed_automatic_backup": "2024-10-26T04:45:00+01:00",
|
||||
"schedule": {"state": "never"},
|
||||
},
|
||||
},
|
||||
@ -834,8 +834,8 @@ async def test_agents_info(
|
||||
"password": None,
|
||||
},
|
||||
"retention": {"copies": None, "days": None},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
"schedule": {"state": "mon"},
|
||||
},
|
||||
},
|
||||
@ -852,8 +852,8 @@ async def test_agents_info(
|
||||
"password": None,
|
||||
},
|
||||
"retention": {"copies": None, "days": None},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
"schedule": {"state": "sat"},
|
||||
},
|
||||
},
|
||||
@ -1022,7 +1022,7 @@ async def test_config_update_errors(
|
||||
@pytest.mark.parametrize(
|
||||
(
|
||||
"command",
|
||||
"last_completed_strategy_backup",
|
||||
"last_completed_automatic_backup",
|
||||
"time_1",
|
||||
"time_2",
|
||||
"attempted_backup_time",
|
||||
@ -1154,7 +1154,7 @@ async def test_config_schedule_logic(
|
||||
hass_storage: dict[str, Any],
|
||||
create_backup: AsyncMock,
|
||||
command: dict[str, Any],
|
||||
last_completed_strategy_backup: str,
|
||||
last_completed_automatic_backup: str,
|
||||
time_1: str,
|
||||
time_2: str,
|
||||
attempted_backup_time: str,
|
||||
@ -1179,8 +1179,8 @@ async def test_config_schedule_logic(
|
||||
"password": "test-password",
|
||||
},
|
||||
"retention": {"copies": None, "days": None},
|
||||
"last_attempted_strategy_backup": last_completed_strategy_backup,
|
||||
"last_completed_strategy_backup": last_completed_strategy_backup,
|
||||
"last_attempted_automatic_backup": last_completed_automatic_backup,
|
||||
"last_completed_automatic_backup": last_completed_automatic_backup,
|
||||
"schedule": {"state": "daily"},
|
||||
},
|
||||
}
|
||||
@ -1210,11 +1210,11 @@ async def test_config_schedule_logic(
|
||||
async_fire_time_changed(hass, fire_all=True) # flush out storage save
|
||||
await hass.async_block_till_done()
|
||||
assert (
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_attempted_strategy_backup"]
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_attempted_automatic_backup"]
|
||||
== attempted_backup_time
|
||||
)
|
||||
assert (
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_completed_strategy_backup"]
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_completed_automatic_backup"]
|
||||
== completed_backup_time
|
||||
)
|
||||
|
||||
@ -1251,22 +1251,22 @@ async def test_config_schedule_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1290,22 +1290,22 @@ async def test_config_schedule_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1329,27 +1329,27 @@ async def test_config_schedule_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-09T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-5": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1373,27 +1373,27 @@ async def test_config_schedule_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-09T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-5": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1417,22 +1417,22 @@ async def test_config_schedule_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1456,22 +1456,22 @@ async def test_config_schedule_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1495,27 +1495,27 @@ async def test_config_schedule_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-09T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-5": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1539,12 +1539,12 @@ async def test_config_schedule_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1595,8 +1595,8 @@ async def test_config_retention_copies_logic(
|
||||
"password": "test-password",
|
||||
},
|
||||
"retention": {"copies": None, "days": None},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": last_backup_time,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": last_backup_time,
|
||||
"schedule": {"state": "daily"},
|
||||
},
|
||||
}
|
||||
@ -1628,11 +1628,11 @@ async def test_config_retention_copies_logic(
|
||||
async_fire_time_changed(hass, fire_all=True) # flush out storage save
|
||||
await hass.async_block_till_done()
|
||||
assert (
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_attempted_strategy_backup"]
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_attempted_automatic_backup"]
|
||||
== backup_time
|
||||
)
|
||||
assert (
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_completed_strategy_backup"]
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_completed_automatic_backup"]
|
||||
== backup_time
|
||||
)
|
||||
|
||||
@ -1641,7 +1641,7 @@ async def test_config_retention_copies_logic(
|
||||
("backup_command", "backup_time"),
|
||||
[
|
||||
(
|
||||
{"type": "backup/generate_with_strategy_settings"},
|
||||
{"type": "backup/generate_with_automatic_settings"},
|
||||
"2024-11-11T12:00:00+01:00",
|
||||
),
|
||||
(
|
||||
@ -1672,22 +1672,22 @@ async def test_config_retention_copies_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1708,22 +1708,22 @@ async def test_config_retention_copies_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1744,27 +1744,27 @@ async def test_config_retention_copies_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-09T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-5": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1785,27 +1785,27 @@ async def test_config_retention_copies_logic(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-09T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-5": MagicMock(
|
||||
date="2024-11-12T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1852,8 +1852,8 @@ async def test_config_retention_copies_logic_manual_backup(
|
||||
"password": "test-password",
|
||||
},
|
||||
"retention": {"copies": None, "days": None},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
"schedule": {"state": "daily"},
|
||||
},
|
||||
}
|
||||
@ -1889,11 +1889,11 @@ async def test_config_retention_copies_logic_manual_backup(
|
||||
async_fire_time_changed(hass, fire_all=True) # flush out storage save
|
||||
await hass.async_block_till_done()
|
||||
assert (
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_attempted_strategy_backup"]
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_attempted_automatic_backup"]
|
||||
== backup_time
|
||||
)
|
||||
assert (
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_completed_strategy_backup"]
|
||||
hass_storage[DOMAIN]["data"]["config"]["last_completed_automatic_backup"]
|
||||
== backup_time
|
||||
)
|
||||
|
||||
@ -1922,17 +1922,17 @@ async def test_config_retention_copies_logic_manual_backup(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1955,17 +1955,17 @@ async def test_config_retention_copies_logic_manual_backup(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -1988,22 +1988,22 @@ async def test_config_retention_copies_logic_manual_backup(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-09T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -2026,17 +2026,17 @@ async def test_config_retention_copies_logic_manual_backup(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -2059,17 +2059,17 @@ async def test_config_retention_copies_logic_manual_backup(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -2092,22 +2092,22 @@ async def test_config_retention_copies_logic_manual_backup(
|
||||
{
|
||||
"backup-1": MagicMock(
|
||||
date="2024-11-09T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-2": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-3": MagicMock(
|
||||
date="2024-11-11T04:45:00+01:00",
|
||||
with_strategy_settings=True,
|
||||
with_automatic_settings=True,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
"backup-4": MagicMock(
|
||||
date="2024-11-10T04:45:00+01:00",
|
||||
with_strategy_settings=False,
|
||||
with_automatic_settings=False,
|
||||
spec=ManagerBackup,
|
||||
),
|
||||
},
|
||||
@ -2155,8 +2155,8 @@ async def test_config_retention_days_logic(
|
||||
"password": "test-password",
|
||||
},
|
||||
"retention": {"copies": None, "days": None},
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": last_backup_time,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": last_backup_time,
|
||||
"schedule": {"state": "never"},
|
||||
},
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ async def test_agents_list_backups(
|
||||
"size": 34519040,
|
||||
"agent_ids": ["cloud.cloud"],
|
||||
"failed_agent_ids": [],
|
||||
"with_strategy_settings": None,
|
||||
"with_automatic_settings": None,
|
||||
}
|
||||
]
|
||||
|
||||
@ -195,8 +195,8 @@ async def test_agents_list_backups_fail_cloud(
|
||||
assert response["result"] == {
|
||||
"agent_errors": {"cloud.cloud": "Failed to list backups"},
|
||||
"backups": [],
|
||||
"last_attempted_strategy_backup": None,
|
||||
"last_completed_strategy_backup": None,
|
||||
"last_attempted_automatic_backup": None,
|
||||
"last_completed_automatic_backup": None,
|
||||
}
|
||||
|
||||
|
||||
@ -218,7 +218,7 @@ async def test_agents_list_backups_fail_cloud(
|
||||
"size": 34519040,
|
||||
"agent_ids": ["cloud.cloud"],
|
||||
"failed_agent_ids": [],
|
||||
"with_strategy_settings": None,
|
||||
"with_automatic_settings": None,
|
||||
},
|
||||
),
|
||||
(
|
||||
|
@ -341,7 +341,7 @@ async def test_agent_info(
|
||||
"name": "Test",
|
||||
"protected": False,
|
||||
"size": 1048576,
|
||||
"with_strategy_settings": None,
|
||||
"with_automatic_settings": None,
|
||||
},
|
||||
),
|
||||
(
|
||||
@ -362,7 +362,7 @@ async def test_agent_info(
|
||||
"name": "Test",
|
||||
"protected": False,
|
||||
"size": 1048576,
|
||||
"with_strategy_settings": None,
|
||||
"with_automatic_settings": None,
|
||||
},
|
||||
),
|
||||
],
|
||||
|
@ -104,7 +104,7 @@ async def test_agents_list_backups(
|
||||
"name": "Kitchen sink syncer",
|
||||
"protected": False,
|
||||
"size": 1234,
|
||||
"with_strategy_settings": None,
|
||||
"with_automatic_settings": None,
|
||||
}
|
||||
]
|
||||
|
||||
@ -183,7 +183,7 @@ async def test_agents_upload(
|
||||
"name": "Test",
|
||||
"protected": False,
|
||||
"size": 0.0,
|
||||
"with_strategy_settings": False,
|
||||
"with_automatic_settings": False,
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user