Skip to content

Commit 1dec7a8

Browse files
firm1firm1
authored andcommitted
add tests for commit by actor
1 parent 28bda3a commit 1dec7a8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎git/test/test_index.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,22 @@ def mixed_iterator():
444444
assertnew_commit.parents[0] ==cur_commit
445445
assertlen(new_commit.parents) ==1
446446
assertcur_head.commit==cur_commit
447+
448+
# commit with other actor
449+
cur_commit=cur_head.commit
450+
451+
my_author=Actor("An author", "[email protected]")
452+
my_committer=Actor("An committer", "[email protected]")
453+
commit_actor=index.commit(commit_message, author=my_author, committer=my_committer)
454+
assertcur_commit!=commit_actor
455+
assertcommit_actor.author.name=="An author"
456+
assertcommit_actor.author.email=="[email protected]"
457+
assertcommit_actor.committer.name=="An committer"
458+
assertcommit_actor.committer.email=="[email protected]"
459+
assertcommit_actor.message==commit_message
460+
assertcommit_actor.parents[0] ==cur_commit
461+
assertlen(new_commit.parents) ==1
462+
assertcur_head.commit==cur_commit
447463

448464
# same index, no parents
449465
commit_message="index without parents"

0 commit comments

Comments
(0)