def test_list_of_circuits_several_circuits(): circuits = list_of_circuits( create_multi_graph(3, [[0, 1], [1, 2], [2, 0], [0, 0]])) assert len(circuits) == 2 assert {frozenset(circuits[0]), frozenset(circuits[1])} == {frozenset({0, 1, 2}), frozenset({0})}
def test_list_of_circuits_several_circuits(): circuits = list_of_circuits( create_multi_graph([[1, 2], [2, 3], [3, 1], [1, 1]])) assert len(circuits) == 2 assert {frozenset(circuits[0]), frozenset(circuits[1])} == {frozenset({1, 2, 3}), frozenset({1})}
def test_list_of_circuits_one_circuit(): circuits = list_of_circuits(create_multi_graph(3, [[0, 1], [1, 2], [2, 0]])) assert len(circuits) == 1 assert set(circuits[0]) == {0, 1, 2}
def test_list_of_circuits_empty(): assert list_of_circuits([]) == []
def test_list_of_circuits_one_circuit(): circuits = list_of_circuits(create_multi_graph([[1, 2], [2, 3], [3, 1]])) assert len(circuits) == 1 assert set(circuits[0]) == {1, 2, 3}
def test_list_of_circuits_empty(): assert list_of_circuits(dict()) == []