class_docstr: Tests for :func:`networkx.generators.lattice.triangular_lattice_graph`
code: def test_periodic(self):
      G = nx.triangular_lattice_graph(4, 6, periodic=True)
      assert len(G) == 12
      assert G.size() == 36
      # all degrees are 6
      assert len([n for n, d in G.degree() if d != 6]) == 0
      G = nx.triangular_lattice_graph(5, 7, periodic=True)
      TLG = nx.triangular_lattice_graph
      pytest.raises(nx.NetworkXError, TLG, 2, 4, periodic=True)
      pytest.raises(nx.NetworkXError, TLG, 4, 4, periodic=True)
      pytest.raises(nx.NetworkXError, TLG, 2, 6, periodic=True)
  
imports: from itertools import product
  import pytest
  import networkx
  from networkx.utils import edges_equal
label_desc: Use image node_id 4 for calling the TestTriangularLatticeGraph obj's underlying member method code with example usage: obj.test_periodic() without return types