Reload a topology work

This commit is contained in:
Julien Duponchelle committed 2016-06-15 16:26:16 +02:00
1 parent 524f8991bc
commit 6d36429870
14 files changed
+167 -34

No files matched your search

+18 -1
View File
@@ -26,7 +26,7 @@ from gns3server.controller.node import Node
from gns3server.controller.compute import Compute
from gns3server.controller.project import Project
from tests.utils import AsyncioBytesIO
from tests.utils import AsyncioBytesIO, AsyncioMagicMock
@pytest.fixture
@@ -54,6 +54,7 @@ def test_addNode(async_run, project, compute):
node1 = Node(project, compute, "node1")
link = Link(project)
project.dump = AsyncioMagicMock()
async_run(link.add_node(node1, 0, 4))
assert link._nodes == [
{
@@ -62,6 +63,7 @@ def test_addNode(async_run, project, compute):
"port_number": 4
}
]
assert project.dump.called
def test_json(async_run, project, compute):
@@ -90,6 +92,21 @@ def test_json(async_run, project, compute):
"capture_file_name": None,
"capture_file_path": None
}
assert link.__json__(topology_dump=True) == {
"link_id": link.id,
"nodes": [
{
"node_id": node1.id,
"adapter_number": 0,
"port_number": 4
},
{
"node_id": node2.id,
"adapter_number": 1,
"port_number": 3
}
]
}
def test_start_streaming_pcap(link, async_run, tmpdir, project):