def test_resolve_cyclical_build_test_dependency():
g = nx.DiGraph()
g.add_node('build-a')
g.add_node('build-b')
g.add_node('test-a')
g.add_node('test-b')
# normal test after build dependencies
g.add_edge('build-a', 'test-a')
# this one will shift from depending on build-b to depending on test-a, which depends on build-b
g.add_edge('build-b', 'test-b')
# the build-time dependence of B on A.
# This one has to be removed. build-b instead must depend on build-a
g.add_edge('test-a', 'build-b')
# the runtime dependency of A on B. This one stays.
g.add_edge('build-b', 'test-a')
compute_build_graph.reorder_cyclical_test_dependencies(g)
assert not ('test-a', 'build-b') in g.edges()
assert not ('build-b', 'test-b') in g.edges()
assert ('test-a', 'test-b') in g.edges()
assert ('build-b', 'test-a') in g.edges()
test_compute_build_graph.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录