File mode should produce one node per file.
(large_store, tmp_path)
| 458 | |
| 459 | |
| 460 | def test_file_mode_aggregation(large_store, tmp_path): |
| 461 | """File mode should produce one node per file.""" |
| 462 | from code_review_graph.visualization import ( |
| 463 | _aggregate_file, |
| 464 | export_graph_data, |
| 465 | ) |
| 466 | |
| 467 | data = export_graph_data(large_store) |
| 468 | full_node_count = len(data["nodes"]) |
| 469 | |
| 470 | agg = _aggregate_file(data) |
| 471 | file_node_count = len(agg["nodes"]) |
| 472 | |
| 473 | assert file_node_count < full_node_count, ( |
| 474 | f"File mode ({file_node_count} nodes) should have fewer nodes " |
| 475 | f"than full mode ({full_node_count} nodes)" |
| 476 | ) |
| 477 | # All nodes should be of kind "File" |
| 478 | for n in agg["nodes"]: |
| 479 | assert n["kind"] == "File" |
| 480 | # Edges should be DEPENDS_ON type |
| 481 | for e in agg["edges"]: |
| 482 | assert e["kind"] == "DEPENDS_ON" |
| 483 | # Mode should be set |
| 484 | assert agg["mode"] == "file" |
| 485 | |
| 486 | |
| 487 | def test_auto_mode_switches_at_threshold(large_store, tmp_path): |
nothing calls this directly
no test coverage detected