Skip to content

Commit 3c75e4a

Browse files
author
mb3152
committed
cleaned up nodal_roles, added tests
1 parent d66cf37 commit 3c75e4a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

brainx/tests/test_nodal_roles.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#test nodal roles
2+
import unittest
3+
import networkx as nx
4+
from .. import nodal_roles as nr
5+
from .. import weighted_modularity as wm
6+
7+
class TestNodalRoles(unittest.TestCase):
8+
def test_participation_coefficient(self):
9+
graph = nx.Graph()
10+
graph.add_node(1)
11+
partition = wm.WeightedPartition(graph)
12+
with self.assertRaises(ValueError):
13+
nr.participation_coefficient(partition)

0 commit comments

Comments
 (0)