Beispiel #1
0
def test_not_node():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0, 1}, {3}]))
Beispiel #2
0
def test_not_covering():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0}, {1}]))
Beispiel #3
0
def test_not_disjoint():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0, 1}, {1, 2}]))
Beispiel #4
0
def test_is_partition():
    G = nx.empty_graph(3)
    assert_true(is_partition(G, [{0, 1}, {2}]))
    assert_true(is_partition(G, ({0, 1}, {2})))
    assert_true(is_partition(G, ([0, 1], [2])))
    assert_true(is_partition(G, [[0, 1], [2]]))
Beispiel #5
0
def test_not_disjoint():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [set([0, 1]), set([1, 2])]))
Beispiel #6
0
def test_not_covering():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [set([0]), set([1])]))
Beispiel #7
0
def test_is_partition():
    G = nx.empty_graph(3)
    assert_true(is_partition(G, [set([0, 1]), set([2])]))
Beispiel #8
0
def test_is_partition():
    G = nx.empty_graph(3)
    assert_true(is_partition(G, [{0, 1}, {2}]))