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

Function test_ls_remotes_deprecated

test/test_remote.py:208–229  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

206
207@utils.requires_network
208def test_ls_remotes_deprecated(testrepo: Repository) -> None:
209 assert 1 == len(testrepo.remotes)
210 remote = testrepo.remotes[0]
211
212 new_refs = remote.list_heads()
213
214 with pytest.warns(DeprecationWarning, match='Use list_heads'):
215 old_refs = remote.ls_remotes()
216
217 assert new_refs
218 assert old_refs
219
220 for new, old in zip(new_refs, old_refs, strict=True):
221 assert new.name == old['name']
222 assert new.oid == old['oid']
223 assert new.local == old['local']
224 assert new.symref_target == old['symref_target']
225 if new.local:
226 assert new.loid == old['loid']
227 else:
228 assert new.loid == pygit2.Oid(b'')
229 assert old['loid'] is None
230
231
232@utils.requires_network

Callers

nothing calls this directly

Calls 2

list_headsMethod · 0.80
ls_remotesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…