def assert_edge_as_obj_added(el: Jelm): n = el.get_node("n1") assert "n2" in n.neighbors.keys() assert "n1" in el.get_node("n2").neighbors assert "n2" in n.target_neighbors.keys()
def assert_edge_jelm_obj_added(el: Jelm): n = el.get_node("n1") assert "n2" in n.neighbors.keys() assert "n1" in el.get_node("n2").neighbors assert "n2" in n.target_neighbors.keys() edge_ids = [e.id for e in n.neighbors["n2"]] assert "fing" in edge_ids
def neighbor_check(el: Jelm): for nid, n in el.nodes.items(): for nid2 in n.neighbors.keys(): assert nid in el.get_node(nid2).neighbors.keys() for nid3 in n.target_neighbors.keys(): assert nid in el.get_node(nid3).source_neighbors.keys() return el
def catch_node_as_obj_add(el: Jelm, e): assert isinstance(e, ValueError) assert isinstance(el.get_node("n10"), Node)
def assert_node_as_obj_added(el: Jelm): assert isinstance(el.get_node("n10"), Node)