class_docstr: Tests for :func:`networkx.generators.lattice.triangular_lattice_graph`
docstr: Tests that the graph is really a triangular lattice.
docstr_tok: ["Tests","that","the","graph","is","really","a","triangular","lattice","."]
code: def test_lattice_points(self):
      """Tests that the graph is really a triangular lattice."""
      for m, n in [(2, 3), (2, 2), (2, 1), (3, 3), (3, 2), (3, 4)]:
          G = nx.triangular_lattice_graph(m, n)
          N = (n + 1) // 2
          assert len(G) == (m + 1) * (1 + N) - (n % 2) * ((m + 1) // 2)
      for i, j in G.nodes():
          nbrs = G[(i, j)]
          if i < N:
              assert (i + 1, j) in nbrs
          if j < m:
              assert (i, j + 1) in nbrs
          if j < m and (i > 0 or j % 2) and (i < N or (j + 1) % 2):
              assert (i + 1, j + 1) in nbrs or (i - 1, j + 1) in nbrs
  
imports: from itertools import product
  import pytest
  import networkx
  from networkx.utils import edges_equal
label_desc: Use image node_id 1 for calling the TestTriangularLatticeGraph obj's underlying member method code with example usage: obj.test_lattice_points() without return types