code: def test_two_nodes(self):
      G = nx.Graph()
      G.add_weighted_edges_from({(1, 2, 1)})
      cycle = nx_app.greedy_tsp(G)
      cost = sum(G[n][nbr]["weight"] for n, nbr in pairwise(cycle))
      validate_solution(cycle, cost, [1, 2, 1], 2)
  
imports: import random
  import pytest
  import networkx
  import networkx.algorithms.approximation
label_desc: Use image node_id 4 for calling the TestGreedyTSP obj's underlying member method code with example usage: obj.test_two_nodes() without return types