code: def test_add_edge(self):
      G = self.G()
      pytest.raises(TypeError, G.add_edge, "A")
  
      G.add_edge("A", "B")  # testing add_edge()
      G.add_edge("A", "B")  # should fail silently
      assert G.has_edge("A", "B")
      assert not G.has_edge("A", "C")
      assert G.has_edge(*("A", "B"))
      if G.is_directed():
          assert not G.has_edge("B", "A")
      else:
          # G is undirected, so B->A is an edge
          assert G.has_edge("B", "A")
  
      G.add_edge("A", "C")  # test directedness
      G.add_edge("C", "A")
      G.remove_edge("C", "A")
      if G.is_directed():
          assert G.has_edge("A", "C")
      else:
          assert not G.has_edge("A", "C")
      assert not G.has_edge("C", "A")
  
imports: import pytest
  import networkx
  from networkx import convert_node_labels_to_integers
  from networkx.utils import edges_equal, nodes_equal
label_desc: Use image node_id 13 for calling the HistoricalTests obj's underlying member method code with example usage: obj.test_add_edge() without return types