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

Function test_read_tree

test/test_index.py:143–154  ·  view source on GitHub ↗
(testrepo: Repository)

Source from the content-addressed store, hash-verified

141
142
143def test_read_tree(testrepo: Repository) -> None:
144 tree_oid = '68aba62e560c0ebc3396e8ae9335232cd93a3f60'
145 # Test reading first tree
146 index = testrepo.index
147 assert len(index) == 2
148 index.read_tree(tree_oid)
149 assert len(index) == 1
150 # Test read-write returns the same oid
151 assert index.write_tree() == tree_oid
152 # Test the index is only modified in memory
153 index.read()
154 assert len(index) == 2
155
156
157def test_write_tree(testrepo: Repository) -> None:

Callers

nothing calls this directly

Calls 3

read_treeMethod · 0.80
write_treeMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…