Mercurial > python-hglib
comparison 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 |
comparison
equal
deleted
inserted
replaced
98:972d069051c5 | 99:2b36619ec0a0 |
---|---|
1 import common, hglib | 1 import common, hglib, datetime |
2 | 2 |
3 class test_commit(common.basetest): | 3 class test_commit(common.basetest): |
4 def test_user(self): | 4 def test_user(self): |
5 self.append('a', 'a') | 5 self.append('a', 'a') |
6 rev, node = self.client.commit('first', addremove=True, user='foo') | 6 rev, node = self.client.commit('first', addremove=True, user='foo') |
28 (rev0.branch, int(rev0.rev), rev0.node[:12])]) | 28 (rev0.branch, int(rev0.rev), rev0.node[:12])]) |
29 | 29 |
30 def test_message_logfile(self): | 30 def test_message_logfile(self): |
31 self.assertRaises(ValueError, self.client.commit, 'foo', logfile='bar') | 31 self.assertRaises(ValueError, self.client.commit, 'foo', logfile='bar') |
32 self.assertRaises(ValueError, self.client.commit) | 32 self.assertRaises(ValueError, self.client.commit) |
33 | |
34 def test_date(self): | |
35 self.append('a', 'a') | |
36 now = datetime.datetime.now().replace(microsecond=0) | |
37 rev0, node0 = self.client.commit('first', addremove=True, | |
38 date=now.isoformat(' ')) | |
39 | |
40 self.assertEquals(now, self.client.tip().date) |