Statistics
| Branch: | Revision:

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

History | View | Annotate | Download (440 Bytes)

1

    
2
from nose.tools import assert_equal, raises
3

    
4
import networkx as nx
5

    
6

    
7
def test_smetric():
8
    g = nx.Graph()
9
    g.add_edge(1, 2)
10
    g.add_edge(2, 3)
11
    g.add_edge(2, 4)
12
    g.add_edge(1, 4)
13
    sm = nx.s_metric(g, normalized=False)
14
    assert_equal(sm, 19.0)
15
#    smNorm = nx.s_metric(g,normalized=True)
16
#    assert_equal(smNorm, 0.95)
17

    
18

    
19
@raises(nx.NetworkXError)
20
def test_normalized():
21
    sm = nx.s_metric(nx.Graph(), normalized=True)