Migration to FastAPI

This commit is contained in:
grossmj committed 2020-10-02 16:07:50 +09:30
1 parent c12b675691
commit eb3cb8a41f
224 files changed
+11254 -13517

No files matched your search

+8 -3
View File
@@ -47,7 +47,8 @@ def dummy_gns3vm(controller, dummy_engine):
return vm
async def test_list(loop, controller):
@pytest.mark.asyncio
async def test_list(controller):
vm = GNS3VM(controller)
with asyncio_patch("gns3server.controller.gns3vm.vmware_gns3_vm.VMwareGNS3VM.list", return_value=[{"vmname": "test", "vmx_path": "test"}]):
@@ -60,14 +61,16 @@ async def test_list(loop, controller):
await vm.list("hyperv")
async def test_json(loop, controller):
@pytest.mark.asyncio
async def test_json(controller):
vm = GNS3VM(controller)
assert vm.__json__() == vm._settings
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not working well on Windows")
async def test_update_settings(loop, controller):
@pytest.mark.asyncio
async def test_update_settings(controller):
vm = GNS3VM(controller)
vm.settings = {
@@ -85,6 +88,7 @@ async def test_update_settings(loop, controller):
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not working well on Windows")
@pytest.mark.asyncio
async def test_auto_start(controller, dummy_gns3vm, dummy_engine):
"""
When start the compute should be add to the controller
@@ -102,6 +106,7 @@ async def test_auto_start(controller, dummy_gns3vm, dummy_engine):
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not working well on Windows")
@pytest.mark.asyncio
async def test_auto_start_with_error(controller, dummy_gns3vm, dummy_engine):
dummy_engine.start.side_effect = GNS3VMError("Dummy error")