diff options
author | Philip Roche <phil.roche@canonical.com> | 2016-06-07 16:56:55 +0100 |
---|---|---|
committer | Philip Roche <phil.roche@canonical.com> | 2016-06-07 16:56:55 +0100 |
commit | 0fb263850967757240937ba3d0290f2f38d8d0cd (patch) | |
tree | b2d92d6c869b5d80479842391a0419bd0a253242 | |
parent | 4500170c1d821f8c944252483a917d5c6863244e (diff) | |
download | python-fastimport-git-0fb263850967757240937ba3d0290f2f38d8d0cd.tar.gz |
test commits with integer marks
-rw-r--r-- | fastimport/tests/test_commands.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/fastimport/tests/test_commands.py b/fastimport/tests/test_commands.py index 16485eb..ccae34a 100644 --- a/fastimport/tests/test_commands.py +++ b/fastimport/tests/test_commands.py @@ -205,6 +205,27 @@ class TestCommitDisplay(TestCase): b"property planet 5 world", repr_bytes(c)) + def test_commit_with_int_mark(self): + # user tuple is (name, email, secs-since-epoch, secs-offset-from-utc) + committer = (b'Joe Wong', b'joe@example.com', 1234567890, -6 * 3600) + properties = { + u'greeting': u'hello', + u'planet': u'world', + } + c = commands.CommitCommand(b'refs/heads/master', 123, None, + committer, b'release v1.0', b':aaa', None, None, + properties=properties) + self.assertEqual( + b"commit refs/heads/master\n" + b"mark :123\n" + b"committer Joe Wong <joe@example.com> 1234567890 -0600\n" + b"data 12\n" + b"release v1.0\n" + b"from :aaa\n" + b"property greeting 5 hello\n" + b"property planet 5 world", + repr_bytes(c)) + class TestCommitCopy(TestCase): def setUp(self): @@ -227,7 +248,6 @@ class TestCommitCopy(TestCase): def test_replace_attr(self): c2 = self.c.copy(mark=b'ccc') - self.assertEqual( repr_bytes(self.c).replace(b'mark :bbb', b'mark :ccc'), repr_bytes(c2) |