Belle II Software development
TestUtils_topological_sort Class Reference
Inheritance diagram for TestUtils_topological_sort:

Public Member Functions

def test_order (self)
 
def test_cyclic (self)
 

Detailed Description

Set of tests for the topological sort function

Definition at line 16 of file test_caf_utils.py.

Member Function Documentation

◆ test_cyclic()

def test_cyclic (   self)
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()

def test_order (   self)
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: