Tests
Here you can read about the tests of meshnetworkx
.
conftest
This module contains pytest fixtures for testing meshnetworkx.
mnx_graph()
Fixture to create and teardown GraphZ instance.
Source code in tests/conftest.py
8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
test_graph
This module contains basic tests for the GraphZ class.
test_add_edge(mnx_graph)
Test adding an edge to the graph.
Source code in tests/test_graph.py
243 244 245 246 247 248 249 250 |
|
test_add_edges_from(self)
Test adding edges from a list with various attributes.
Source code in tests/test_graph.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
|
test_add_node_simple(mnx_graph)
Test adding a node to the graph.
Source code in tests/test_graph.py
11 12 13 14 15 16 |
|
test_add_node_with_attributes(mnx_graph)
Test adding a node with attributes.
Source code in tests/test_graph.py
69 70 71 72 73 74 75 76 77 78 |
|
test_add_nodes_from(mnx_graph)
Test adding nodes from a list and removing some of them.
Source code in tests/test_graph.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
test_clear(mnx_graph, times)
Test clearing all nodes from the graph.
Source code in tests/test_graph.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
test_clear_orig(mnx_graph)
Test clearing the graph and its attributes.
Source code in tests/test_graph.py
325 326 327 328 329 330 331 332 333 334 |
|
test_duplicate_node_warning(mnx_graph)
How do we handle adding a node with a key that already exists?
Source code in tests/test_graph.py
235 236 237 238 239 240 |
|
test_has_edge(mnx_graph)
Test checking if an edge exists in the graph.
Source code in tests/test_graph.py
265 266 267 268 269 270 271 272 273 274 |
|
test_has_node(mnx_graph)
Test checking if a node exists in the graph.
Source code in tests/test_graph.py
370 371 372 373 374 375 |
|
test_has_node_str(mnx_graph)
Test checking if a node exists in the graph with a string.
Source code in tests/test_graph.py
378 379 380 381 382 383 |
|
test_mnx_to_nx()
Test converting a GraphZ instance to a NetworkX graph.
Source code in tests/test_graph.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
test_node_attribute_management(mnx_graph)
Test adding nodes with various attributes and updating them correctly.
Source code in tests/test_graph.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
test_node_view_assignment_raises_error(mnx_graph)
Test that assigning to the node view raises an error.
Source code in tests/test_graph.py
350 351 352 353 354 355 356 |
|
test_node_view_data_assignment_raises_error(mnx_graph)
Test that assigning to the node view raises an error.
Source code in tests/test_graph.py
359 360 361 362 363 364 365 366 367 |
|
test_nodes_with_data(mnx_graph)
Test getting nodes with attributes.
Source code in tests/test_graph.py
145 146 147 148 149 150 151 152 |
|
test_nodes_without_data(mnx_graph)
Test getting nodes without attributes.
Source code in tests/test_graph.py
135 136 137 138 139 140 141 142 |
|
test_nx_to_mnx()
Test converting a NetworkX graph to a GraphZ instance.
Source code in tests/test_graph.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
test_nx_to_mnx_to_nx_nodes_only()
Test converting a NetworkX graph to a GraphZ instance and back to NetworkX.
Source code in tests/test_graph.py
188 189 190 191 192 193 194 195 196 197 198 199 |
|
test_nx_to_zgraph_to_nx()
Test converting a NetworkX graph to a GraphZ instance and back to NetworkX.
Source code in tests/test_graph.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
test_nx_to_zgraph_to_nx_int()
Test converting a NetworkX graph to a GraphZ instance and back to NetworkX.
Source code in tests/test_graph.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
|
test_remove_edge(mnx_graph)
Test removing an edge from the graph.
Source code in tests/test_graph.py
253 254 255 256 257 258 259 260 261 262 |
|
test_remove_edge_2(mnx_graph)
Test removing an edge from the graph with multiple edges.
Source code in tests/test_graph.py
277 278 279 280 281 282 283 284 285 |
|
test_remove_edges_from(self)
Test removing edges from the graph.
Source code in tests/test_graph.py
316 317 318 319 320 321 322 |
|
test_remove_node(mnx_graph)
Test removing a node from the graph.
Source code in tests/test_graph.py
81 82 83 84 85 86 87 88 89 90 |
|
test_remove_node_hardcore(mnx_graph)
Test removing a node with edges from the graph.
Source code in tests/test_graph.py
93 94 95 96 97 98 99 100 101 102 |
|
test_removing_node_removes_edge(mnx_graph)
Test removing a node also removes its edges.
Source code in tests/test_graph.py
338 339 340 341 342 343 344 345 346 347 |
|
test_to_networkx(mnx_graph)
Test converting GraphZ instance to NetworkX graph.
Source code in tests/test_graph.py
122 123 124 125 126 127 128 129 130 131 132 |
|
test_types_for_nodes(mnx_graph, input_data, error)
Test that we can use different types for nodes.
Source code in tests/test_graph.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
|
test_interface
Tests to ensure that the GraphZ interface matches the NetworkX Graph interface.
test_graph_attributes()
Test that all attributes in NetworkX Graph are present in GraphZ.
Source code in tests/test_interface.py
115 116 117 118 119 120 121 122 123 124 125 |
|
test_graph_interface()
Test that the GraphZ interface matches the NetworkX Graph interface.
Source code in tests/test_interface.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
test_graph_methods()
Test that all methods in NetworkX Graph are present in GraphZ.
Source code in tests/test_interface.py
105 106 107 108 109 110 111 112 |
|
test_mesh
This module contains tests while running in multiple processes.
test_subprocess_communication(mnx_graph)
Test communication in a subprocess.
Source code in tests/test_mesh.py
18 19 20 21 22 23 24 25 |
|
test_subprocess_multiple_nodes(mnx_graph)
Test adding multiple nodes in a subprocess.
Source code in tests/test_mesh.py
38 39 40 41 42 43 44 45 46 47 48 49 |
|
test_subprocess_remove_node(mnx_graph)
Test removing a node in a subprocess.
Source code in tests/test_mesh.py
60 61 62 63 64 65 66 67 68 |
|