summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-06-09 18:07:22 +0100
committerBaserock Gerrit <gerrit@baserock.org>2015-06-10 08:58:01 +0000
commit117413f11e59c66071663a28d02b701e9c871236 (patch)
tree95435150f4301c92452187a2b6755b79c9352bf2
parentd8e7abe6273e2f429b1f52fb43c356e871da6aac (diff)
downloadmorph-117413f11e59c66071663a28d02b701e9c871236.tar.gz
Fix test suite
The test suite was failing in my Baserock 15.19 chroot with: FAILURE: test_commit_tree (gitdir_tests.GitDirectoryContentsTests) Traceback (most recent call last): File "morphlib/gitdir_tests.py", line 294, in test_commit_tree self.assertEqual(expected, gd.get_commit_contents(commit).split('\n')) AssertionError: Lists differ: ['tree 01d830ae9bae1a9970a9f14... != ['tree 01d830ae9bae1a9970a9f14... First differing element 2: author Author Name <author@email> 683074800 +0000 author Author Name <author@email> 683074800 +0100 ['tree 01d830ae9bae1a9970a9f1491c914ad177f8afce', 'parent 1240834484cebc4ba8cc40cd5b76f6dffd937a50', - 'author Author Name <author@email> 683074800 +0000', ? ^ + 'author Author Name <author@email> 683074800 +0100', ? ^ - 'committer Committer Name <committer@email> 683074800 +0000', ? ^ + 'committer Committer Name <committer@email> 683074800 +0100', ? ^ '', 'MESSAGE', ''] 1 failures, 0 errors 1543 excluded statements 57 excluded modules Time: 8.4 s Change-Id: If03e7ccbb5e3415eead9dcbcf908d3d2717e8fe0
-rw-r--r--morphlib/gitdir_tests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/morphlib/gitdir_tests.py b/morphlib/gitdir_tests.py
index 0eafc0e8..0ec7b0f1 100644
--- a/morphlib/gitdir_tests.py
+++ b/morphlib/gitdir_tests.py
@@ -20,6 +20,7 @@ import datetime
import os
import shutil
import tempfile
+import time
import unittest
import morphlib
@@ -270,14 +271,15 @@ class GitDirectoryContentsTests(unittest.TestCase):
cname = 'Committer Name'
cemail = 'committer@email'
pseudo_now = datetime.datetime.fromtimestamp(683074800)
+ timezone = time.strftime('%z')
now_str = "683074800"
message= 'MESSAGE'
expected = [
"tree %(tree)s",
"parent %(parent)s",
- "author %(aname)s <%(aemail)s> %(now_str)s +0000",
- "committer %(cname)s <%(cemail)s> %(now_str)s +0000",
+ "author %(aname)s <%(aemail)s> %(now_str)s %(timezone)s",
+ "committer %(cname)s <%(cemail)s> %(now_str)s %(timezone)s",
"",
"%(message)s",
"",