test_triads.py 332 B

1234567891011121314
  1. """Unit tests for the :mod:`networkx.generators.triads` module."""
  2. import pytest
  3. from networkx import triad_graph
  4. def test_triad_graph():
  5. G = triad_graph("030T")
  6. assert [tuple(e) for e in ("ab", "ac", "cb")] == sorted(G.edges())
  7. def test_invalid_name():
  8. with pytest.raises(ValueError):
  9. triad_graph("bogus")