Skip to content

Commit bef68ba

Browse files
committed
added tests
1 parent 141b78f commit bef68ba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

git/test/test_index.py

+11
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,17 @@ def mixed_iterator():
470470
assert cur_head.commit == commit_actor
471471
assert cur_head.log()[-1].actor == my_committer
472472

473+
# commit with author_date and commit_date
474+
cur_commit = cur_head.commit
475+
commit_message = u"commit with dates by Avinash Sajjanshetty"
476+
477+
new_commit = index.commit(commit_message, author_date="2006-04-07T22:13:13", commit_date="2005-04-07T22:13:13")
478+
assert cur_commit != new_commit
479+
print(new_commit.authored_date, new_commit.committed_date)
480+
assert new_commit.message == commit_message
481+
assert new_commit.authored_date == 1144447993
482+
assert new_commit.committed_date == 1112911993
483+
473484
# same index, no parents
474485
commit_message = "index without parents"
475486
commit_no_parents = index.commit(commit_message, parent_commits=list(), head=True)

0 commit comments

Comments
 (0)