2020-03-03 04:15:18 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import hive
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
2020-03-03 19:56:33 +00:00
|
|
|
def HiveTenRTenC():
|
2020-03-03 04:15:18 +00:00
|
|
|
router_hive = hive.RouterHive(n_relays=10, n_clients=10, netid="hive")
|
|
|
|
router_hive.Start()
|
|
|
|
|
|
|
|
yield router_hive
|
|
|
|
|
|
|
|
router_hive.Stop()
|
2020-03-03 19:56:33 +00:00
|
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
|
|
def HiveThirtyRTenC():
|
|
|
|
router_hive = hive.RouterHive(n_relays=30, n_clients=10, netid="hive")
|
|
|
|
router_hive.Start()
|
|
|
|
|
|
|
|
yield router_hive
|
|
|
|
|
|
|
|
router_hive.Stop()
|
|
|
|
|
|
|
|
@pytest.fixture()
|
|
|
|
def HiveArbitrary():
|
|
|
|
router_hive = None
|
|
|
|
def _make(n_relays=10, n_clients=10, netid="hive"):
|
|
|
|
nonlocal router_hive
|
|
|
|
router_hive = hive.RouterHive(n_relays=30, n_clients=10, netid="hive")
|
|
|
|
router_hive.Start()
|
|
|
|
return router_hive
|
|
|
|
|
|
|
|
yield _make
|
|
|
|
|
|
|
|
router_hive.Stop()
|
|
|
|
|