Merge branch 'dev' into feature/1800_model-a-basic-router-subclass-of-node

This commit is contained in:
Chris McCarthy
2023-08-31 11:39:21 +01:00
8 changed files with 324 additions and 51 deletions

View File

@@ -0,0 +1,17 @@
import json
from primaite.simulator.network.container import Network
def test_creating_container():
"""Check that we can create a network container"""
net = Network()
assert net.nodes == {}
assert net.links == {}
def test_describe_state():
"""Check that we can describe network state without raising errors, and that the result is JSON serialisable."""
net = Network()
state = net.describe_state()
json.dumps(state) # if this function call raises an error, the test fails, state was not JSON-serialisable