def test_check_requested_destination_fails_with_not_enough_memory(self):
    self.mox.StubOutWithMock(self.task, '_check_host_is_up')
    self.mox.StubOutWithMock(db, 'service_get_by_compute_host')
    self.task._check_host_is_up(self.destination)
    db.service_get_by_compute_host(self.context, self.destination).AndReturn({'compute_node': [{'free_ram_mb': 511}]})
    self.mox.ReplayAll()
    self.assertRaises(exception.MigrationPreCheckError, self.task._check_requested_destination)
def test_check_requested_destination_fails_with_not_enough_memory(self):
    self.mox.StubOutWithMock(self.task, '_check_host_is_up')
    self.mox.StubOutWithMock(db, 'service_get_by_compute_host')
    self.task._check_host_is_up(self.destination)
    db.service_get_by_compute_host(self.context, self.destination).AndReturn({'compute_node': [{'free_ram_mb': 511}]})
    self.mox.ReplayAll()
    self.assertRaises(exception.MigrationPreCheckError, self.task._check_requested_destination)