We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5ab1a0 commit 6563ce9Copy full SHA for 6563ce9
tests/test_dependencies.py
@@ -19,6 +19,26 @@ def test_nullable_dependency(thing_tables):
19
assert len(c) == len(c.fetch()) == 5
20
21
22
+def test_topo_sort():
23
+ import networkx as nx
24
+ import datajoint as dj
25
+
26
+ graph = nx.DiGraph(
27
+ [
28
+ ("`a`.`a`", "`a`.`m`"),
29
+ ("`a`.`a`", "`a`.`z`"),
30
+ ("`a`.`m`", "`a`.`m__part`"),
31
+ ("`a`.`z`", "`a`.`m__part`"),
32
+ ]
33
+ )
34
+ assert dj.dependencies.topo_sort(graph) == [
35
+ "`a`.`a`",
36
+ "`a`.`z`",
37
+ "`a`.`m`",
38
+ "`a`.`m__part`",
39
40
41
42
def test_unique_dependency(thing_tables):
43
"""test nullable unique foreign key"""
44
# Thing C has a nullable dependency on B whose primary key is composite
0 commit comments