Statistics
| Branch: | Revision:

iof-tools / networkxMiCe / networkx-master / networkx / algorithms / tests / test_asteroidal.py @ 5cef0f13

History | View | Annotate | Download (637 Bytes)

1
import networkx as nx
2
from nose.tools import assert_true
3
from nose.tools import assert_false
4
from nose.tools import assert_equal
5

    
6

    
7
def test_is_at_free():
8

    
9
    is_at_free = nx.asteroidal.is_at_free
10

    
11
    cycle = nx.cycle_graph(6)
12
    assert_false(is_at_free(cycle))
13

    
14
    path = nx.path_graph(6)
15
    assert_true(is_at_free(path))
16

    
17
    small_graph = nx.complete_graph(2)
18
    assert_true(is_at_free(small_graph))
19

    
20
    petersen = nx.petersen_graph()
21
    assert_false(is_at_free(petersen))
22

    
23
    clique = nx.complete_graph(6)
24
    assert_true(is_at_free(clique))
25

    
26
    line_clique = nx.line_graph(clique)
27
    assert_false(is_at_free(line_clique))