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

Function test_read

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

Source from the content-addressed store, hash-verified

72
73
74def test_read(barerepo: Repository) -> None:
75 with pytest.raises(TypeError):
76 barerepo.read(123) # type: ignore
77 utils.assertRaisesWithArg(KeyError, '1' * 40, barerepo.read, '1' * 40)
78
79 ab = barerepo.read(BLOB_OID)
80 a = barerepo.read(BLOB_HEX)
81 assert ab == a
82 assert (ObjectType.BLOB, b'a contents\n') == a
83
84 a2 = barerepo.read('7f129fd57e31e935c6d60a0c794efe4e6927664b')
85 assert (ObjectType.BLOB, b'a contents 2\n') == a2
86
87 a_hex_prefix = BLOB_HEX[:4]
88 a3 = barerepo.read(a_hex_prefix)
89 assert (ObjectType.BLOB, b'a contents\n') == a3
90
91
92def test_write(barerepo: Repository) -> None:

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…