Example #1
0
def test_not_node():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0, 1}, {3}]))
Example #2
0
def test_not_covering():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0}, {1}]))
Example #3
0
def test_not_disjoint():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [{0, 1}, {1, 2}]))
Example #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]]))
Example #5
0
def test_not_disjoint():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [set([0, 1]), set([1, 2])]))
Example #6
0
def test_not_covering():
    G = nx.empty_graph(3)
    assert_false(is_partition(G, [set([0]), set([1])]))
Example #7
0
def test_is_partition():
    G = nx.empty_graph(3)
    assert_true(is_partition(G, [set([0, 1]), set([2])]))
Example #8
0
def test_is_partition():
    G = nx.empty_graph(3)
    assert_true(is_partition(G, [{0, 1}, {2}]))