MCPcopy Create free account
hub / github.com/libgit2/pygit2 / test_hashfile

Function test_hashfile

test/test_repository_bare.py:200–208  ·  view source on GitHub ↗
(barerepo: Repository)

Source from the content-addressed store, hash-verified

198
199
200def test_hashfile(barerepo: Repository) -> None:
201 data = 'bazbarfoo'
202 handle, tempfile_path = tempfile.mkstemp()
203 with os.fdopen(handle, 'w') as fh:
204 fh.write(data)
205 hashed_sha1 = pygit2.hashfile(tempfile_path)
206 pathlib.Path(tempfile_path).unlink()
207 written_sha1 = barerepo.create_blob(data)
208 assert hashed_sha1 == written_sha1
209
210
211def test_conflicts_in_bare_repository(barerepo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

hashfileMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…