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