(az)
| 36 | |
| 37 | |
| 38 | def 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 | |
| 53 | def test_az_basic(az): |
no test coverage detected