Beispiel #1
0
 def test_example(self):
     deps = resolve_dependencies({
         'a': ['b', 'c'],
         'b': ['c'],
         'c': ['d'],
         'd': []
     })
     self.assertEqual(list(deps), ['d', 'c', 'b', 'a'])
Beispiel #2
0
 def test_missing_link(self):
     deps = resolve_dependencies({'a': 'b', 'c': 'd'})
     with self.assertRaises(ValueError):
         list(deps)
Beispiel #3
0
 def test_unresolvable(self):
     deps = resolve_dependencies({'a': 'b', 'b': 'a'})
     with self.assertRaises(ValueError):
         list(deps)
 def test_example(self):
     deps = resolve_dependencies({'a': ['b', 'c'], 'b': ['c'],
                                  'c': ['d'], 'd': []})
     self.assertEqual(list(deps), ['d', 'c', 'b', 'a'])
 def test_missing_link(self):
     deps = resolve_dependencies({'a': 'b', 'c': 'd'})
     with self.assertRaises(ValueError):
         list(deps)
 def test_unresolvable(self):
     deps = resolve_dependencies({'a': 'b', 'b': 'a'})
     with self.assertRaises(ValueError):
         list(deps)