tests.traversal.test_depthfirst

tests.traversal.test_depthfirst#

Unit tests for traversal.depthfirst module.

Functions

test_dfs_empty(func)

Ensure ValueError is raised on empty universes.

test_dfs_finds_first_vertex(...)

Ensure we find the starting vertex, if it matches criteria.

test_dfs_none_universe(graph_clrs09_22_6, func)

Ensure DFS works when universe = None.

test_dfs_nonuniverse(graph_clrs09_22_6, func)

Ensure starting at a vertex outside of the universe causes an error.

test_dfs_search_for(graph_clrs09_22_6, func, ...)

Test that we find vertices we should, and don't we shouldn't.

test_dfs_search_out_of_uni(...)

Ensure we don't find a vertex outside of the universe.

test_dfs_search_wrong_attr(...)

Ensure the attribute selection is working right.

test_dft_deterministic(graph_clrs09_22_6, func)

Make sure they do the same thing every time, given the same inputs.

test_dft_empty(func)

Test ValueError is thrown when universe is empty.

test_dft_nonuniverse(graph_clrs09_22_6, func)

Test ValueError is thrown when starting vertex is not in the universe.

test_dft_stress(graph_clrs09_22_6, combo)

Depth-first traversal stress testing.

test_dft_trav_out_of_uni(graph_clrs09_22_6, func)

Ensure we don't find vertices connected to the graph, but out of the universe.

test_dfti_from(graph_clrs09_22_6, start, ...)

Test traversing from a given starting point, using the iterative implementation.

test_dfti_none_universe(graph_clrs09_22_6)

Ensure DFTI work when universe = None.

test_dftr_from(graph_clrs09_22_6, start, ...)

Test traversing from a given starting point, using the recursive implementation.

test_dftr_none_universe(graph_clrs09_22_6)

Ensure DFTR work when universe = None.