def test_suspend(loop, vm):

    control_vm_result = MagicMock()
    control_vm_result.match.group.decode.return_value = "running"
    with asyncio_patch("gns3server.modules.qemu.QemuVM._control_vm", return_value=control_vm_result) as mock:
        loop.run_until_complete(asyncio.async(vm.suspend()))
        assert mock.called_with("system_reset")
Exemple #2
0
async def test_suspend(vm):

    control_vm_result = MagicMock()
    control_vm_result.match.group.decode.return_value = "running"
    with asyncio_patch("gns3server.compute.qemu.QemuVM._control_vm", return_value=control_vm_result) as mock:
        await vm.suspend()
        assert mock.called_with("system_reset")
Exemple #3
0
def test_suspend(loop, vm):

    control_vm_result = MagicMock()
    control_vm_result.match.group.decode.return_value = "running"
    with asyncio_patch("gns3server.modules.qemu.QemuVM._control_vm",
                       return_value=control_vm_result) as mock:
        loop.run_until_complete(asyncio. async (vm.suspend()))
        assert mock.called_with("system_reset")
def test_reload(loop, vm):

    with asyncio_patch("gns3server.modules.qemu.QemuVM._control_vm") as mock:
        loop.run_until_complete(asyncio.async(vm.reload()))
        assert mock.called_with("system_reset")
Exemple #5
0
def test_reload(loop, vm):

    with asyncio_patch("gns3server.modules.qemu.QemuVM._control_vm") as mock:
        loop.run_until_complete(asyncio. async (vm.reload()))
        assert mock.called_with("system_reset")
Exemple #6
0
async def test_reload(vm):

    with asyncio_patch("gns3server.compute.qemu.QemuVM._control_vm") as mock:
        await vm.reload()
        assert mock.called_with("system_reset")