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

Method test_get_stats

tests/test_graph.py:191–207  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

189 assert "process" not in names
190
191 def test_get_stats(self):
192 self.store.upsert_node(self._make_file_node())
193 self.store.upsert_node(self._make_func_node())
194 self.store.upsert_node(self._make_class_node())
195 self.store.upsert_edge(EdgeInfo(
196 kind="CONTAINS", source="/test/file.py",
197 target="/test/file.py::my_func", file_path="/test/file.py",
198 ))
199 self.store.commit()
200
201 stats = self.store.get_stats()
202 assert stats.total_nodes == 3
203 assert stats.total_edges == 1
204 assert stats.nodes_by_kind["File"] == 1
205 assert stats.nodes_by_kind["Function"] == 1
206 assert stats.nodes_by_kind["Class"] == 1
207 assert "python" in stats.languages
208
209 def test_impact_radius(self):
210 # Create a chain: file_a -> func_a -> (calls) -> func_b in file_b

Callers

nothing calls this directly

Calls 8

_make_file_nodeMethod · 0.95
_make_func_nodeMethod · 0.95
_make_class_nodeMethod · 0.95
EdgeInfoClass · 0.90
upsert_nodeMethod · 0.80
upsert_edgeMethod · 0.80
commitMethod · 0.80
get_statsMethod · 0.80

Tested by

no test coverage detected