MCPcopy Index your code
hub / github.com/Persper/code-analytics / assert_graph_match_history

Function assert_graph_match_history

test/test_graphs/test_analyzer.py:38–50  ·  view source on GitHub ↗
(az)

Source from the content-addressed store, hash-verified

36
37
38def assert_graph_match_history(az):
39 # total edits data stored in the graph should match az.history
40 master_commits, _ = az.ri.iter(from_beginning=True)
41 master_sha_set = set([c.hexsha for c in master_commits])
42 g = az.graph_server.get_graph()
43 for func in g.nodes():
44 print(func)
45 func_sum = 0
46 for sha in az.history:
47 if sha in master_sha_set and func in az.history[sha]:
48 func_sum += az.history[sha][func]
49 if g.node[func]['defined']:
50 assert(func_sum == g.node[func]['num_lines'])
51
52
53def test_az_basic(az):

Callers 1

test_az_basicFunction · 0.70

Calls 3

nodesMethod · 0.80
iterMethod · 0.45
get_graphMethod · 0.45

Tested by

no test coverage detected