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

Function test_transfer_progress

test/test_remote.py:297–307  ·  view source on GitHub ↗
(emptyrepo: Repository)

Source from the content-addressed store, hash-verified

295
296
297def test_transfer_progress(emptyrepo: Repository) -> None:
298 class MyCallbacks(pygit2.RemoteCallbacks):
299 def transfer_progress(self, stats: TransferProgress) -> None:
300 self.tp = stats
301
302 callbacks = MyCallbacks()
303 remote = emptyrepo.remotes[0]
304 stats = remote.fetch(callbacks=callbacks)
305 assert stats.received_bytes == callbacks.tp.received_bytes
306 assert stats.indexed_objects == callbacks.tp.indexed_objects
307 assert stats.received_objects == callbacks.tp.received_objects
308
309
310def test_update_tips(emptyrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 2

fetchMethod · 0.80
MyCallbacksClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…