def test_add_dombackup_dedup(self, build_mock_domain): dom = build_mock_domain backup_group = BackupGroup(domlst=(dom, )) backup_group.add_dombackup(DomBackup(dom, dev_disks=("vda", ))) backup_group.add_dombackup(DomBackup(dom, dev_disks=("vdb", ))) assert len(backup_group.backups) == 1 assert len(backup_group.backups[0].disks.keys()) == 2
def build_main_backup_group(groups): main_group = BackupGroup() for g in groups: for d in g.backups: main_group.add_dombackup(d) return main_group