def setUp(self): super(InstanceUsageAuditLogTest, self).setUp() self.context = context.get_admin_context() timeutils.set_time_override(datetime.datetime(2012, 7, 5, 10, 0, 0)) self.controller = ial.InstanceUsageAuditLogController() self.stubs.Set(utils, 'last_completed_audit_period', fake_last_completed_audit_period) self.stubs.Set(db, 'service_get_all', fake_service_get_all) self.stubs.Set(db, 'task_log_get_all', fake_task_log_get_all)
def setUp(self): super(InstanceUsageAuditLogTest, self).setUp() self.context = context.get_admin_context() timeutils.set_time_override(datetime.datetime(2012, 7, 5, 10, 0, 0)) self.controller = ial.InstanceUsageAuditLogController() self.host_api = self.controller.host_api def fake_service_get_all(context, disabled): self.assertIsNone(disabled) return TEST_COMPUTE_SERVICES self.stubs.Set(utils, 'last_completed_audit_period', fake_last_completed_audit_period) self.stubs.Set(db, 'service_get_all', fake_service_get_all) self.stubs.Set(db, 'task_log_get_all', fake_task_log_get_all)
def _set_up_controller(self): self.controller = ial.InstanceUsageAuditLogController()