Ejemplo n.º 1
0
def test_virtual_machine_power_on_wrong_power_state(wait_for_vcenter_task,
                                                    connection):
    wait_for_vcenter_task.side_effect = vim.fault.InvalidPowerState
    vm = VirtualMachine()
    vm.power_on()
    vm.__setattr__('_vm_object', mock.MagicMock())
    vm.power_on()
    assert wait_for_vcenter_task.call_count == 1
Ejemplo n.º 2
0
def test_virtual_machine_power_on(wait_for_vcenter_task, connection):
    vm = VirtualMachine()
    vm.power_on()
    vm.__setattr__('_vm_object', mock.MagicMock())
    vm.power_on()
    assert wait_for_vcenter_task.call_count == 1