Skip to content

Commit 3b2fab6

Browse files
Continued adding to tests
1 parent 23e9b45 commit 3b2fab6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ def test_02_dag(self):
162162

163163
# Test additional fields for edge
164164
self.assertEqual(b3.children.through.objects.filter(child=c1)[0].name, "b3 c1")
165+
self.assertEqual(b3.descendants_edges().first(), NetworkEdge.objects.get(parent=b3, child=c2))
166+
self.assertEqual(a1.ancestors_edges().first(), NetworkEdge.objects.get(parent=root, child=a1))
167+
self.assertTrue(NetworkEdge.objects.get(parent=a1, child=b2) in a1.clan_edges())
168+
self.assertTrue(NetworkEdge.objects.get(parent=a1, child=b1) in a1.clan_edges())
169+
self.assertTrue(NetworkEdge.objects.get(parent=root, child=a1) in a1.clan_edges())
165170

171+
# Test shortest_path
166172
log.debug("shortest_path x2")
167173
self.assertTrue(
168174
[p.name for p in root.shortest_path(c1)] == ["root", "a3", "b3", "c1"]
@@ -500,7 +506,7 @@ def run_test():
500506
# When n=22, there are on the order of 1 million paths through the graph
501507
# from node 0, so results for intermediate nodes need to be cached
502508

503-
log = logging.getLogger("test_3")
509+
log = logging.getLogger("test_03")
504510

505511
n = 22 # Keep it an even number
506512

0 commit comments

Comments
 (0)