Set of tests for the topological sort function
Definition at line 16 of file test_caf_utils.py.
◆ test_cyclic()
Tests that cyclic dependency returns empty list
Definition at line 32 of file test_caf_utils.py.
32 def test_cyclic(self):
33 """
34 Tests that cyclic dependency returns empty list
35 """
36 dependencies = {}
37 dependencies['c'] = ['a']
38 dependencies['a'] = ['b']
39 dependencies['b'] = ['c']
40 order = topological_sort(dependencies)
41 self.assertFalse(order)
42
43
◆ test_order()
Checks that the resulting order is correct for a basic test
Definition at line 21 of file test_caf_utils.py.
21 def test_order(self):
22 """
23 Checks that the resulting order is correct for a basic test
24 """
25 dependencies = {}
26 dependencies['c'] = ['a', 'b']
27 dependencies['b'] = ['a']
28 dependencies['a'] = []
29 order = topological_sort(dependencies)
30 self.assertEqual(order, ['c', 'b', 'a'])
31
The documentation for this class was generated from the following file: