Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / networkx / generators / tests / test_triads.py @ 5cef0f13

History | View | Annotate | Download (585 Bytes)

1
# test_triads.py - unit tests for the triads module
2
#
3
# Copyright 2015 NetworkX developers.
4
#
5
# This file is part of NetworkX.
6
#
7
# NetworkX is distributed under a BSD license; see LICENSE.txt for more
8
# information.
9
"""Unit tests for the :mod:`networkx.generators.triads` module."""
10
from nose.tools import assert_equal
11
from nose.tools import raises
12

    
13
from networkx import triad_graph
14

    
15

    
16
def test_triad_graph():
17
    G = triad_graph('030T')
18
    assert_equal([tuple(e) for e in ('ab', 'ac', 'cb')], sorted(G.edges()))
19

    
20

    
21
@raises(ValueError)
22
def test_invalid_name():
23
    triad_graph('bogus')