Mercurial > python-hglib
diff tests/test-commit.py @ 99:2b36619ec0a0
client: add date field to revision
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Tue, 17 Jan 2012 22:36:48 +0200 |
parents | 943aff89b068 |
children | 1b47146a4a2c |
line wrap: on
line diff
--- a/tests/test-commit.py Tue Jan 17 22:24:24 2012 +0200 +++ b/tests/test-commit.py Tue Jan 17 22:36:48 2012 +0200 @@ -1,4 +1,4 @@ -import common, hglib +import common, hglib, datetime class test_commit(common.basetest): def test_user(self): @@ -30,3 +30,11 @@ def test_message_logfile(self): self.assertRaises(ValueError, self.client.commit, 'foo', logfile='bar') self.assertRaises(ValueError, self.client.commit) + + def test_date(self): + self.append('a', 'a') + now = datetime.datetime.now().replace(microsecond=0) + rev0, node0 = self.client.commit('first', addremove=True, + date=now.isoformat(' ')) + + self.assertEquals(now, self.client.tip().date)