tests.traversal.test_breadthfirst

tests.traversal.test_breadthfirst#

Unit tests for traversal.breadthfirst module.

Functions

test_bfs_empty()

Ensure BFS doesn't return anything when the universe is empty.

test_bfs_finds_first_vertex(graph_clrs09_22_6)

Ensure BFS finds the starting vertex, if that's what it's given.

test_bfs_none_universe(graph_clrs09_22_6)

Ensure BFS works with universe = None.

test_bfs_nonuniverse_vert(graph_clrs09_22_6)

Ensure ValueError raised on a starting vertex outside the universe.

test_bfs_search_for(graph_clrs09_22_6, ...)

Ensure we can find vertices with a breadth-first search.

test_bfs_search_for_nonexistent(...)

Ensure we don't find a vertex that doesn't exist.

test_bfs_search_out_of_uni(graph_clrs09_22_6)

Ensure we don't find anything outside of the universe.

test_bfs_search_wrong_attr(graph_clrs09_22_6)

Ensure we don't find the wrong attribute.

test_bft_empty()

Ensure no traversal on an empty universe.

test_bft_from(graph_clrs09_22_6, start, expected)

Make sure traversals work right, starting from any given node.

test_bft_none_universe(graph_clrs09_22_6)

Ensure BFT works when universe = None.

test_bft_nonuniverse_vert(graph_clrs09_22_6)

Ensure starting on a Vertex outside the universe raises an error.

test_bft_stress(graph_clrs09_22_6)

Stress-test breadth first traversal.

test_bft_trav_out_of_uni(graph_clrs09_22_6)

Ensure we don't traverse outside the universe.