1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-27 09:18:09 +00:00
gns3-server/old_tests/dynamips/test_hub.py
2015-01-14 11:43:23 +01:00

26 lines
503 B
Python

from gns3server.modules.dynamips import Hub
from gns3server.modules.dynamips import NIO_Null
import pytest
@pytest.fixture
def hub(request, hypervisor):
hub = Hub(hypervisor, "hub")
request.addfinalizer(hub.delete)
return hub
def test_hub_exists(hub):
assert hub.list()
def test_add_remove_nio(hub):
nio = NIO_Null(hub.hypervisor)
hub.add_nio(nio, 0) # add NIO to port 0
assert hub.mapping[0] == nio
hub.remove_nio(0) # remove NIO from port 0
nio.delete()