class_docstr: Unit tests for :func:`~networkx.geographical_threshold_graph`
class_docstr_tok: ["Unit","tests","for",":","func",":","`","~networkx.geographical_threshold_graph","`"]
docstr: Tests for providing an alternate distance metric to the generator.
docstr_tok: ["Tests","for","providing","an","alternate","distance","metric","to","the","generator","."]
code: def test_metric(self):
      """Tests for providing an alternate distance metric to the generator."""
      # Use the L1 metric.
      G = nx.geographical_threshold_graph(50, 10, metric=l1dist)
      for u, v in combinations(G, 2):
          # Adjacent vertices must exceed the threshold.
          if v in G[u]:
              assert join(G, u, v, 10, -2, l1dist)
          # Nonadjacent vertices must not exceed the threshold.
          else:
              assert not join(G, u, v, 10, -2, l1dist)
  
imports: import math
  import random
  from itertools import combinations
  import pytest
  import networkx
label_desc: Use image node_id 3 for calling the TestGeographicalThresholdGraph obj's underlying member method code with example usage: obj.test_metric() without return types