MCPcopy Index your code
hub / github.com/tirth8205/code-review-graph / test_file_mode_aggregation

Function test_file_mode_aggregation

tests/test_visualization.py:460–484  ·  view source on GitHub ↗

File mode should produce one node per file.

(large_store, tmp_path)

Source from the content-addressed store, hash-verified

458
459
460def 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
487def test_auto_mode_switches_at_threshold(large_store, tmp_path):

Callers

nothing calls this directly

Calls 2

export_graph_dataFunction · 0.90
_aggregate_fileFunction · 0.90

Tested by

no test coverage detected