mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 18:56:27 +00:00
Fix create a node from an appliance test.
This commit is contained in:
parent
081ba31b50
commit
657698a961
@ -75,14 +75,13 @@ def test_create_node_from_appliance(http_controller, controller, project, comput
|
|||||||
"name": "test",
|
"name": "test",
|
||||||
"symbol": "guest.svg",
|
"symbol": "guest.svg",
|
||||||
"default_name_format": "{name}-{0}",
|
"default_name_format": "{name}-{0}",
|
||||||
"server": "example.com"
|
"compute_id": "example.com"
|
||||||
})}
|
})}
|
||||||
with asyncio_patch("gns3server.controller.project.Project.add_node_from_appliance") as mock:
|
with asyncio_patch("gns3server.controller.project.Project.add_node_from_appliance", return_value={"name": "test", "node_type": "qemu", "compute_id": "example.com"}) as mock:
|
||||||
response = http_controller.post("/projects/{}/appliances/{}".format(project.id, id), {
|
response = http_controller.post("/projects/{}/appliances/{}".format(project.id, id), {
|
||||||
"x": 42,
|
"x": 42,
|
||||||
"y": 12
|
"y": 12
|
||||||
})
|
})
|
||||||
mock.assert_called_with(id, x=42, y=12, compute_id=None)
|
mock.assert_called_with(id, x=42, y=12, compute_id=None)
|
||||||
print(response.body)
|
|
||||||
assert response.route == "/projects/{project_id}/appliances/{appliance_id}"
|
assert response.route == "/projects/{project_id}/appliances/{appliance_id}"
|
||||||
assert response.status == 201
|
assert response.status == 201
|
||||||
|
Loading…
Reference in New Issue
Block a user