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

Function test_read_commit

test/test_commit.py:53–72  ·  view source on GitHub ↗
(barerepo: Repository)

Source from the content-addressed store, hash-verified

51
52
53def test_read_commit(barerepo: Repository) -> None:
54 commit = barerepo[COMMIT_SHA]
55 assert isinstance(commit, Commit)
56 assert COMMIT_SHA == commit.id
57 parents = commit.parents
58 assert 1 == len(parents)
59 assert 'c2792cfa289ae6321ecf2cd5806c2194b0fd070c' == parents[0].id
60 assert commit.message_encoding is None
61 assert commit.message == (
62 'Second test data commit.\n\nThis commit has some additional text.\n'
63 )
64 commit_time = 1288481576
65 assert commit_time == commit.commit_time
66 assert commit.committer == Signature(
67 'Dave Borowitz', 'dborowitz@google.com', commit_time, -420
68 )
69 assert commit.author == Signature(
70 'Dave Borowitz', 'dborowitz@google.com', 1288477363, -420
71 )
72 assert '967fce8df97cc71722d3c2a5930ef3e6f1d27b12' == commit.tree.id
73
74
75def test_new_commit(barerepo: Repository) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…