(self)
| 349 | ) |
| 350 | |
| 351 | def test_remove_vertices(self) -> None: |
| 352 | random_vertices: list[int] = random.sample(range(101), 20) |
| 353 | |
| 354 | # build graphs WITHOUT edges |
| 355 | undirected_graph = GraphAdjacencyMatrix( |
| 356 | vertices=random_vertices, edges=[], directed=False |
| 357 | ) |
| 358 | directed_graph = GraphAdjacencyMatrix( |
| 359 | vertices=random_vertices, edges=[], directed=True |
| 360 | ) |
| 361 | |
| 362 | # test remove_vertex worked |
| 363 | for num in random_vertices: |
| 364 | self.__assert_graph_vertex_exists_check( |
| 365 | undirected_graph, directed_graph, num |
| 366 | ) |
| 367 | |
| 368 | undirected_graph.remove_vertex(num) |
| 369 | directed_graph.remove_vertex(num) |
| 370 | |
| 371 | self.__assert_graph_vertex_does_not_exist_check( |
| 372 | undirected_graph, directed_graph, num |
| 373 | ) |
| 374 | |
| 375 | def test_add_and_remove_vertices_repeatedly(self) -> None: |
| 376 | random_vertices1: list[int] = random.sample(range(51), 20) |
nothing calls this directly
no test coverage detected