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

Function test_analyze_interface

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

Source from the content-addressed store, hash-verified

95
96
97def test_analyze_interface(az):
98 # test various ways to invoke process function
99 az.analyze(from_beginning=True, into_branches=True)
100
101 repo_path = os.path.join(root_path, 'repos/test_feature_branch')
102 az1 = Analyzer(repo_path, CGraphServer(C_FILENAME_REGEXES))
103 # A B
104 az1.analyze(from_beginning=True, num_commits=2, into_branches=True)
105 # C D
106 az1.analyze(continue_iter=True, num_commits=2, into_branches=True)
107 # E F K
108 az1.analyze(continue_iter=True, num_commits=3, into_branches=True)
109 # should see "The range specified is empty, terminated."
110 az1.analyze(continue_iter=True, num_commits=1, into_branches=True)
111 assert_analyzer_equal(az1, az)
112
113 az2 = Analyzer(repo_path, CGraphServer(C_FILENAME_REGEXES))
114 ri = RepoIterator(repo_path)
115 commits, _ = ri.iter(from_beginning=True)
116 assert(len(commits) == 7)
117 # should see "No history exists yet, terminated."
118 az2.analyze(continue_iter=True, num_commits=1, into_branches=True)
119 # A B C
120 az2.analyze(from_beginning=True, num_commits=3, into_branches=True)
121 # D E F
122 az2.analyze(from_beginning=True,
123 end_commit_sha=commits[5].hexsha,
124 into_branches=True)
125 # K
126 az2.analyze(from_beginning=True,
127 end_commit_sha=commits[6].hexsha,
128 into_branches=True)
129 assert_analyzer_equal(az2, az)
130
131
132def test_save(az):

Callers

nothing calls this directly

Calls 6

analyzeMethod · 0.95
iterMethod · 0.95
AnalyzerClass · 0.90
CGraphServerClass · 0.90
RepoIteratorClass · 0.90
assert_analyzer_equalFunction · 0.85

Tested by

no test coverage detected