本文整理汇总了Python中vunit.dependency_graph.DependencyGraph.get_dependencies方法的典型用法代码示例。如果您正苦于以下问题:Python DependencyGraph.get_dependencies方法的具体用法?Python DependencyGraph.get_dependencies怎么用?Python DependencyGraph.get_dependencies使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vunit.dependency_graph.DependencyGraph
的用法示例。
在下文中一共展示了DependencyGraph.get_dependencies方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_dependencies_detects_circular_dependencies
# 需要导入模块: from vunit.dependency_graph import DependencyGraph [as 别名]
# 或者: from vunit.dependency_graph.DependencyGraph import get_dependencies [as 别名]
def test_get_dependencies_detects_circular_dependencies(self):
nodes = ["a", "b", "c"]
dependencies = [("b", "a"), ("c", "b"), ("a", "c")]
graph = DependencyGraph()
self._add_nodes_and_dependencies(graph, nodes, dependencies)
try:
graph.get_dependencies(set("a"))
except CircularDependencyException as exc:
self.assertEqual(exc.path, ["a", "b", "c", "a"])
else:
self.fail("Exception not raised")
示例2: test_get_dependencies
# 需要导入模块: from vunit.dependency_graph import DependencyGraph [as 别名]
# 或者: from vunit.dependency_graph.DependencyGraph import get_dependencies [as 别名]
def test_get_dependencies(self):
nodes = ["a", "b", "c", "d", "e"]
dependencies = [("b", "a"), ("c", "b"), ("d", "c"), ("d", "e")]
graph = DependencyGraph()
self._add_nodes_and_dependencies(graph, nodes, dependencies)
self.assertEqual(graph.get_dependencies(set("a")), set(("a", "b", "c", "d")))
self.assertEqual(graph.get_dependencies(set("e")), set(("d", "e")))