Skip to content

Commit 6284811

Browse files
author
CindeeM
committed
TEST: added test for setter of WeightedPartition, catch partition with missing nodes
1 parent dcacb5f commit 6284811

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

brainx/tests/test_weighted_modularity.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def test_init(self):
5353
# test communities cannot be replaced by garbage
5454
with self.assertRaises(TypeError):
5555
part.communities = 11
56+
# doesnt work if nodes are missing from partition
57+
with self.assertRaises(ValueError):
58+
part.communities = [set([1,2,3])]
5659
# but we can pass a valid community partition
5760
part.communities = comm
5861
self.assertEqual(part.communities, comm)

0 commit comments

Comments
 (0)