Skip to content

Commit

Permalink
add incomplete defaultdict test
Browse files Browse the repository at this point in the history
  • Loading branch information
bernlu committed Apr 15, 2024
1 parent afbac88 commit 21334c1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions networkit/test/test_vizbridges.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,24 @@ def testVizEdgeScoresDefaultdict(self):
edgeScores=scores,
)

def testVizEdgeScoresDefaultdictOneEntry(self):
for dim, directed, weighted in zip(
vizbridges.Dimension, [True, False], [True, False]
):
with self.subTest(dim=dim, directed=directed, weighted=weighted):
G = self.getSmallGraph(weighted, directed)
G.indexEdges()
scores = defaultdict(lambda: 0)
# create incomplete defaultdict
for u, v in G.iterEdges():
scores[u, v] = 1
break
vizbridges.widgetFromGraph(
G,
dimension=dim,
edgeScores=scores,
)

def testVizEdgePalette(self):
for dim, directed, weighted in zip(
vizbridges.Dimension, [True, False], [True, False]
Expand Down

0 comments on commit 21334c1

Please sign in to comment.