diff options
author | firm1 <firm1@users.noreply.github.com> | 2015-01-07 11:42:57 +0100 |
---|---|---|
committer | firm1 <firm1@github.com> | 2015-01-07 13:09:58 +0100 |
commit | 1dec7a822424bbe58b7b2a7787b1ea32683a9c19 (patch) | |
tree | c9a69b20eb58e70105903075f67c4974181ff070 | |
parent | 28bda3aaa19955d1c172bd86d62478bee024bf7b (diff) | |
download | gitpython-1dec7a822424bbe58b7b2a7787b1ea32683a9c19.tar.gz |
add tests for commit by actor
-rw-r--r-- | git/test/test_index.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/git/test/test_index.py b/git/test/test_index.py index f7504b32..a0d1ffbc 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -444,6 +444,22 @@ class TestIndex(TestBase): assert new_commit.parents[0] == cur_commit assert len(new_commit.parents) == 1 assert cur_head.commit == cur_commit + + # commit with other actor + cur_commit = cur_head.commit + + my_author = Actor("An author", "author@example.com") + my_committer = Actor("An committer", "committer@example.com") + commit_actor = index.commit(commit_message, author=my_author, committer=my_committer) + assert cur_commit != commit_actor + assert commit_actor.author.name == "An author" + assert commit_actor.author.email == "author@example.com" + assert commit_actor.committer.name == "An committer" + assert commit_actor.committer.email == "committer@example.com" + assert commit_actor.message == commit_message + assert commit_actor.parents[0] == cur_commit + assert len(new_commit.parents) == 1 + assert cur_head.commit == cur_commit # same index, no parents commit_message = "index without parents" |