def _report(self, body):
     return {
         'backup': lambda body: backup_report.from_dict(self.id, body),
         'restore': lambda body: restore_report.from_dict(self.id, body)
     }[self._type](body)
 def setUp(self):
     mock = mock_report.backup_report(errors=['explosions'],
                                      restorable=True)
     self.report = backup_report.from_dict(1, mock)