mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-25 03:12:23 +02:00
fix: Fix failing tests and adress the MCP 2.x incompatibility failures
This commit is contained in:
parent
28f0d9c009
commit
5d08cc92a4
@ -5,4 +5,4 @@
|
|||||||
# Or directly: pip install -r mcp-requirements.txt
|
# Or directly: pip install -r mcp-requirements.txt
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|
||||||
fastmcp>=3.4.0
|
fastmcp>=3.4.0,<4
|
||||||
|
|||||||
@ -1327,11 +1327,10 @@ async def test_read_interface_statuses(vm):
|
|||||||
b"eth0=invalid\r\n",
|
b"eth0=invalid\r\n",
|
||||||
b"",
|
b"",
|
||||||
])
|
])
|
||||||
vm.project.emit = MagicMock()
|
with patch.object(vm.project, "emit") as emit:
|
||||||
|
await DockerVM._read_interface_statuses(vm, reader)
|
||||||
|
|
||||||
await DockerVM._read_interface_statuses(vm, reader)
|
assert emit.call_args_list == [
|
||||||
|
|
||||||
assert vm.project.emit.call_args_list == [
|
|
||||||
call("node.interface_status", {
|
call("node.interface_status", {
|
||||||
"project_id": vm.project.id,
|
"project_id": vm.project.id,
|
||||||
"node_id": vm.id,
|
"node_id": vm.id,
|
||||||
@ -1355,11 +1354,10 @@ async def test_read_interface_statuses_periodically_resynchronizes(vm):
|
|||||||
reader = MagicMock()
|
reader = MagicMock()
|
||||||
reader.readline = AsyncMock(side_effect=[b"eth0=0x1003\n", b"eth0=0x1003\n", b""])
|
reader.readline = AsyncMock(side_effect=[b"eth0=0x1003\n", b"eth0=0x1003\n", b""])
|
||||||
vm._INTERFACE_STATUS_RESYNC_INTERVAL = 0
|
vm._INTERFACE_STATUS_RESYNC_INTERVAL = 0
|
||||||
vm.project.emit = MagicMock()
|
with patch.object(vm.project, "emit") as emit:
|
||||||
|
await DockerVM._read_interface_statuses(vm, reader)
|
||||||
|
|
||||||
await DockerVM._read_interface_statuses(vm, reader)
|
assert emit.call_count == 2
|
||||||
|
|
||||||
assert vm.project.emit.call_count == 2
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user