示例#1
0
def test_is_intersection_oneways():
    #
    #  1 -->-- 2 -->-- 3
    #
    g = nx.DiGraph()
    g.add_edges_from([(1, 2), (2, 3)])
    assert tools.is_intersection(g, 2) is False
示例#2
0
def test_is_intersection_easy():
    #
    #  1 -- 2 -- 3
    #
    g = nx.DiGraph()
    g.add_edges_from([(1, 2), (2, 1), (2, 3), (3, 2)])
    assert tools.is_intersection(g, 2) is False
示例#3
0
def test_is_intersection_oneways():
    #
    #  1 -->-- 2 -->-- 3
    #
    g = nx.DiGraph()
    g.add_edges_from([(1, 2), (2, 3)])
    assert tools.is_intersection(g, 2) is False
示例#4
0
def test_is_intersection_easy():
    #
    #  1 -- 2 -- 3
    #
    g = nx.DiGraph()
    g.add_edges_from([(1, 2), (2, 1), (2, 3), (3, 2)])
    assert tools.is_intersection(g, 2) is False
示例#5
0
def test_is_intersection_3_way():
    #
    #  1 -- 2 -- 3
    #       |
    #       4
    g = nx.DiGraph()
    g.add_edges_from([(1, 2), (2, 1), (2, 3), (3, 2), (2, 4), (4, 2)])
    assert tools.is_intersection(g, 2)
示例#6
0
def test_is_intersection_3_way():
    #
    #  1 -- 2 -- 3
    #       |
    #       4
    g = nx.DiGraph()
    g.add_edges_from([(1, 2), (2, 1), (2, 3), (3, 2), (2, 4), (4, 2)])
    assert tools.is_intersection(g, 2)