9from unittest
import TestCase
11from caf.utils
import topological_sort
12from caf.utils
import get_iov_from_file
13from caf.utils
import IoV
18 Set of tests for the topological sort function
23 Checks that the resulting order is correct
for a basic test
26 dependencies['c'] = [
'a',
'b']
27 dependencies[
'b'] = [
'a']
28 dependencies[
'a'] = []
29 order = topological_sort(dependencies)
30 self.assertEqual(order, [
'c',
'b',
'a'])
34 Tests that cyclic dependency returns empty list
37 dependencies['c'] = [
'a']
38 dependencies[
'a'] = [
'b']
39 dependencies[
'b'] = [
'c']
40 order = topological_sort(dependencies)
41 self.assertFalse(order)
51 test get_iov_from_file()
53 from basf2
import find_file
54 path = find_file(
'framework/tests/root_input.root')
55 iov = get_iov_from_file(path)
56 self.assertTrue(IoV(0, 1, 0, 1).contains(iov))
63if __name__ ==
'__main__':
def test_get_iov_from_file(self)