File: test_smetric.py

package info (click to toggle)
python-networkx 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,780 kB
  • ctags: 1,910
  • sloc: python: 29,050; makefile: 126
file content (14 lines) | stat: -rw-r--r-- 230 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14

from nose.tools import assert_equal

import networkx as nx

def test_smetric():
    g = nx.Graph()
    g.add_edge(1,2)
    g.add_edge(2,3)
    g.add_edge(2,4)
    g.add_edge(1,4)
    sm = nx.s_metric(g)
    assert_equal(sm, 19)