Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/networkx/algorithms/tests/test_smetric.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 import pytest | |
2 | |
3 import networkx as nx | |
4 | |
5 | |
6 def test_smetric(): | |
7 g = nx.Graph() | |
8 g.add_edge(1, 2) | |
9 g.add_edge(2, 3) | |
10 g.add_edge(2, 4) | |
11 g.add_edge(1, 4) | |
12 sm = nx.s_metric(g, normalized=False) | |
13 assert sm == 19.0 | |
14 | |
15 | |
16 # smNorm = nx.s_metric(g,normalized=True) | |
17 # assert_equal(smNorm, 0.95) | |
18 | |
19 | |
20 def test_normalized(): | |
21 with pytest.raises(nx.NetworkXError): | |
22 sm = nx.s_metric(nx.Graph(), normalized=True) |