MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_raise_on_cycle_two

Method test_raise_on_cycle_two

test/base/test_dependency.py:138–169  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

136 )
137
138 def test_raise_on_cycle_two(self):
139 # this condition was arising from ticket:362 and was not treated
140 # properly by topological sort
141
142 node1 = "node1"
143 node2 = "node2"
144 node3 = "node3"
145 node4 = "node4"
146 tuples = [
147 (node1, node2),
148 (node3, node1),
149 (node2, node4),
150 (node3, node2),
151 (node2, node3),
152 ]
153 allitems = self._nodes_from_tuples(tuples)
154
155 try:
156 list(topological.sort(tuples, allitems))
157 assert False
158 except exc.CircularDependencyError as err:
159 eq_(err.cycles, {"node1", "node3", "node2"})
160 eq_(
161 err.edges,
162 {
163 ("node3", "node1"),
164 ("node2", "node3"),
165 ("node3", "node2"),
166 ("node1", "node2"),
167 ("node2", "node4"),
168 },
169 )
170
171 def test_raise_on_cycle_three(self):
172 question, issue, providerservice, answer, provider = (

Callers

nothing calls this directly

Calls 3

_nodes_from_tuplesMethod · 0.95
eq_Function · 0.90
sortMethod · 0.45

Tested by

no test coverage detected