MCPcopy Create free account
hub / github.com/Persper/code-analytics / test_black_set

Function test_black_set

test/test_analytics/test_call_commit_graph.py:99–121  ·  view source on GitHub ↗

The CRLF commit: https://github.com/bitcoin/bitcoin/commit/0a61b0df1224a5470bcddab302bc199ca5a9e356 Its parent: https://github.com/bitcoin/bitcoin/commit/5b721607b1057df4dfe97f80d235ed372312f398 Its grandparent: https://github.com/bitcoin/bitcoin/commit/2ef9cfa5b81877b1023f2fcb82f5a638b

()

Source from the content-addressed store, hash-verified

97
98@pytest.mark.asyncio
99async def test_black_set():
100 """
101 The CRLF commit: https://github.com/bitcoin/bitcoin/commit/0a61b0df1224a5470bcddab302bc199ca5a9e356
102 Its parent: https://github.com/bitcoin/bitcoin/commit/5b721607b1057df4dfe97f80d235ed372312f398
103 Its grandparent: https://github.com/bitcoin/bitcoin/commit/2ef9cfa5b81877b1023f2fcb82f5a638b1eb013c
104 Its great grandparent: https://github.com/bitcoin/bitcoin/commit/7d7797b141dbd4ed9db1dda94684beb3395c2534
105 """
106 repo_path = os.path.join(root_path, 'repos/bitcoin')
107 bitcoin_url = 'https://github.com/bitcoin/bitcoin'
108 if not os.path.exists(repo_path):
109 Repo.clone_from(bitcoin_url, repo_path)
110 az = Analyzer(repo_path, CPPGraphServer(CPP_FILENAME_REGEXES))
111 crlf_sha = '0a61b0df1224a5470bcddab302bc199ca5a9e356'
112 ggparent_sha = '7d7797b141dbd4ed9db1dda94684beb3395c2534'
113 rev = ggparent_sha + '..' + crlf_sha
114 await az.analyze(rev=rev)
115 ccgraph = az.get_graph()
116 devdict = ccgraph.commit_devranks(0.85)
117 devdict2 = ccgraph.commit_devranks(0.85, black_set=set([crlf_sha]))
118 assert(len(devdict) == 3)
119 assert(len(devdict2) == 2)
120 assert(crlf_sha in devdict)
121 assert(crlf_sha not in devdict2)

Callers

nothing calls this directly

Calls 4

analyzeMethod · 0.95
get_graphMethod · 0.95
AnalyzerClass · 0.90
commit_devranksMethod · 0.80

Tested by

no test coverage detected