MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / test_init_check

Method test_init_check

graphs/graph_adjacency_matrix.py:289–309  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

287 return undirected_graph, directed_graph, random_vertices, random_edges
288
289 def test_init_check(self) -> None:
290 (
291 undirected_graph,
292 directed_graph,
293 random_vertices,
294 random_edges,
295 ) = self.__generate_graphs(20, 0, 100, 4)
296
297 # test graph initialization with vertices and edges
298 for num in random_vertices:
299 self.__assert_graph_vertex_exists_check(
300 undirected_graph, directed_graph, num
301 )
302
303 for edge in random_edges:
304 self.__assert_graph_edge_exists_check(
305 undirected_graph, directed_graph, edge
306 )
307
308 assert not undirected_graph.directed
309 assert directed_graph.directed
310
311 def test_contains_vertex(self) -> None:
312 random_vertices: list[int] = random.sample(range(101), 20)

Callers

nothing calls this directly

Tested by

no test coverage detected