(barerepo: Repository)
| 106 | |
| 107 | |
| 108 | def test_new_commit_encoding(barerepo: Repository) -> None: |
| 109 | repo = barerepo |
| 110 | encoding = 'iso-8859-1' |
| 111 | message = 'New commit.\n\nMessage with non-ascii chars: ééé.\n' |
| 112 | committer = Signature('John Doe', 'jdoe@example.com', 12346, 0, encoding) |
| 113 | author = Signature('J. David Ibáñez', 'jdavid@example.com', 12345, 0, encoding) |
| 114 | tree = '967fce8df97cc71722d3c2a5930ef3e6f1d27b12' |
| 115 | tree_prefix = tree[:5] |
| 116 | |
| 117 | parents = [COMMIT_SHA[:5]] |
| 118 | sha = repo.create_commit( |
| 119 | None, author, committer, message, tree_prefix, parents, encoding |
| 120 | ) |
| 121 | commit = repo[sha] |
| 122 | assert isinstance(commit, Commit) |
| 123 | |
| 124 | assert ObjectType.COMMIT.value == commit.type |
| 125 | assert 'iso-8859-1' == commit.message_encoding |
| 126 | assert message.encode(encoding) == commit.raw_message |
| 127 | assert 12346 == commit.commit_time |
| 128 | assert committer == commit.committer |
| 129 | assert author == commit.author |
| 130 | assert tree == commit.tree.id |
| 131 | assert Oid(hex=tree) == commit.tree_id |
| 132 | assert 1 == len(commit.parents) |
| 133 | assert COMMIT_SHA == commit.parents[0].id |
| 134 | assert Oid(hex=COMMIT_SHA) == commit.parent_ids[0] |
| 135 | |
| 136 | |
| 137 | def test_modify_commit(barerepo: Repository) -> None: |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…