def test_check_instance_host_is_up_fails_if_not_found(self):
    self.mox.StubOutWithMock(db, 'service_get_by_compute_host')
    db.service_get_by_compute_host(self.context, 'host').AndRaise(exception.NotFound)
    self.mox.ReplayAll()
    self.assertRaises(exception.ComputeServiceUnavailable, self.task._check_host_is_up, 'host')
def test_check_instance_host_is_up_fails_if_not_found(self):
    self.mox.StubOutWithMock(db, 'service_get_by_compute_host')
    db.service_get_by_compute_host(self.context, 'host').AndRaise(exception.NotFound)
    self.mox.ReplayAll()
    self.assertRaises(exception.ComputeServiceUnavailable, self.task._check_host_is_up, 'host')