MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / test_init_check

Method test_init_check

graphs/graph_adjacency_list.py:278–297  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

276 return undirected_graph, directed_graph, random_vertices, random_edges
277
278 def test_init_check(self) -> None:
279 (
280 undirected_graph,
281 directed_graph,
282 random_vertices,
283 random_edges,
284 ) = self.__generate_graphs(20, 0, 100, 4)
285
286 # test graph initialization with vertices and edges
287 for num in random_vertices:
288 self.__assert_graph_vertex_exists_check(
289 undirected_graph, directed_graph, num
290 )
291
292 for edge in random_edges:
293 self.__assert_graph_edge_exists_check(
294 undirected_graph, directed_graph, edge
295 )
296 assert not undirected_graph.directed
297 assert directed_graph.directed
298
299 def test_contains_vertex(self) -> None:
300 random_vertices: list[int] = random.sample(range(101), 20)

Callers

nothing calls this directly

Tested by

no test coverage detected