def test_check_requested_destination_fails_with_hypervisor_diff(self):
    self.mox.StubOutWithMock(self.task, '_check_host_is_up')
    self.mox.StubOutWithMock(self.task, '_check_destination_has_enough_memory')
    self.mox.StubOutWithMock(self.task, '_get_compute_info')
    self.task._check_host_is_up(self.destination)
    self.task._check_destination_has_enough_memory()
    self.task._get_compute_info(self.instance_host).AndReturn({'hypervisor_type': 'b'})
    self.task._get_compute_info(self.destination).AndReturn({'hypervisor_type': 'a'})
    self.mox.ReplayAll()
    self.assertRaises(exception.InvalidHypervisorType, self.task._check_requested_destination)
def test_check_requested_destination_fails_with_hypervisor_diff(self):
    self.mox.StubOutWithMock(self.task, '_check_host_is_up')
    self.mox.StubOutWithMock(self.task, '_check_destination_has_enough_memory')
    self.mox.StubOutWithMock(self.task, '_get_compute_info')
    self.task._check_host_is_up(self.destination)
    self.task._check_destination_has_enough_memory()
    self.task._get_compute_info(self.instance_host).AndReturn({'hypervisor_type': 'b'})
    self.task._get_compute_info(self.destination).AndReturn({'hypervisor_type': 'a'})
    self.mox.ReplayAll()
    self.assertRaises(exception.InvalidHypervisorType, self.task._check_requested_destination)