This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/networkx/generators/tests/test_triads.py
2020-07-30 01:16:18 +02:00

23 lines
548 B
Python

# test_triads.py - unit tests for the triads module
#
# Copyright 2015 NetworkX developers.
#
# This file is part of NetworkX.
#
# NetworkX is distributed under a BSD license; see LICENSE.txt for more
# information.
"""Unit tests for the :mod:`networkx.generators.triads` module."""
import pytest
from networkx import triad_graph
def test_triad_graph():
G = triad_graph('030T')
assert [tuple(e) for e in ('ab', 'ac', 'cb')] == sorted(G.edges())
def test_invalid_name():
with pytest.raises(ValueError):
triad_graph('bogus')