33import math
44from typing import Dict
55
6- from ngraph . lib . graph import StrictMultiDiGraph
6+ from netsim . applications . packet_network . graph import SimpleGraph
77
88from netsim .applications .packet_network .simulator import NetSim
99from netsim .applications .packet_network .base import (
@@ -37,7 +37,7 @@ def _src_profile(size: int = 1000, interval: float = 1.0, count: int = 10) -> Di
3737# --------------------------------------------------------------------------- #
3838def test_load_graph_creates_objects () -> None :
3939 sim = NetSim ()
40- g = StrictMultiDiGraph ()
40+ g = SimpleGraph ()
4141 g .add_node ("S" , ns_type = "PacketSource" , ns_attr = _src_profile ())
4242 g .add_node ("D" , ns_type = "PacketSink" , ns_attr = {})
4343 g .add_edge ("S" , "D" , key = 1 , ns_attr = {})
@@ -58,7 +58,7 @@ def test_load_graph_creates_objects() -> None:
5858# --------------------------------------------------------------------------- #
5959def test_run_until_time_collects_stats () -> None :
6060 sim = NetSim (stat_interval = 1.0 ) # 1 s snapshots
61- g = StrictMultiDiGraph ()
61+ g = SimpleGraph ()
6262 g .add_node ("S" , ns_type = "PacketSource" , ns_attr = _src_profile (count = 6 ))
6363 g .add_node ("D" , ns_type = "PacketSink" , ns_attr = {})
6464 g .add_edge ("S" , "D" , key = 1 , ns_attr = {})
@@ -82,7 +82,7 @@ def test_run_until_time_collects_stats() -> None:
8282# --------------------------------------------------------------------------- #
8383def test_switch_interfaces_and_forwarding () -> None :
8484 sim = NetSim ()
85- g = StrictMultiDiGraph ()
85+ g = SimpleGraph ()
8686
8787 g .add_node ("SRC" , ns_type = "PacketSource" , ns_attr = _src_profile (count = 5 ))
8888 g .add_node ("SW" , ns_type = "PacketSwitch" , ns_attr = {})
@@ -131,7 +131,7 @@ def _safe_todict(self): # type: ignore[override]
131131 monkeypatch .setattr (_Packet , "todict" , _safe_todict , raising = True )
132132
133133 sim = NetSim ()
134- g = StrictMultiDiGraph ()
134+ g = SimpleGraph ()
135135 g .add_node ("S" , ns_type = "PacketSource" , ns_attr = _src_profile (count = 2 ))
136136 g .add_node ("D" , ns_type = "PacketSink" , ns_attr = {})
137137 g .add_edge ("S" , "D" , key = 1 , ns_attr = {})
0 commit comments