(self)
| 309 | assert directed_graph.directed |
| 310 | |
| 311 | def test_contains_vertex(self) -> None: |
| 312 | random_vertices: list[int] = random.sample(range(101), 20) |
| 313 | |
| 314 | # Build graphs WITHOUT edges |
| 315 | undirected_graph = GraphAdjacencyMatrix( |
| 316 | vertices=random_vertices, edges=[], directed=False |
| 317 | ) |
| 318 | directed_graph = GraphAdjacencyMatrix( |
| 319 | vertices=random_vertices, edges=[], directed=True |
| 320 | ) |
| 321 | |
| 322 | # Test contains_vertex |
| 323 | for num in range(101): |
| 324 | assert (num in random_vertices) == undirected_graph.contains_vertex(num) |
| 325 | assert (num in random_vertices) == directed_graph.contains_vertex(num) |
| 326 | |
| 327 | def test_add_vertices(self) -> None: |
| 328 | random_vertices: list[int] = random.sample(range(101), 20) |
nothing calls this directly
no test coverage detected