docstr: should create an undirected Graph
docstr_tok: ["should","create","an","undirected","Graph"]
code: def test_to_undirected(self):
      """should create an undirected Graph"""
  
      sm = StructureModel()
      sm.add_edges_from([(1, 2), (2, 1), (2, 3), (3, 4)])
  
      udg = sm.to_undirected()
      assert all(edge in udg.edges for edge in [(2, 3), (3, 4)])
      assert (1, 2) in udg.edges or (2, 1) in udg.edges
      assert len(udg.edges) == 3
  
imports: import pytest
  from networkx.exception import NodeNotFound
  from causalnex.structure import StructureModel
label_desc: Use image node_id 7 for calling the TestStructureModel obj's underlying member method code with example usage: obj.test_to_undirected() without return types