'Ensure we handle missing temp snapshot for a backup.'

def test_cleanup_temp_snapshot_for_one_backup_not_found(self):

    vol1_id = self._create_volume_db_entry()
    self._create_volume_attach(vol1_id)
    db.volume_update(self.ctxt, vol1_id, {'status': 'backing-up'})
    backup = self._create_backup_db_entry(status=fields.BackupStatus.ERROR, volume_id=vol1_id, temp_snapshot_id=str(uuid.uuid4()))
    self.assertIsNone(self.backup_mgr._cleanup_temp_volumes_snapshots_for_one_backup(self.ctxt, backup))
    self.assertFalse(self.volume_mocks['delete_snapshot'].called)
    self.assertIsNone(backup.temp_snapshot_id)
    backup.destroy()
    db.volume_destroy(self.ctxt, vol1_id)
