소스 검색

Make index tests a bit less strict, fixes FTBFS on some systems.
Closes: #666328

Jelmer Vernooij 13 년 전
부모
커밋
edf3f6e423
4개의 변경된 파일85개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 0
      debian/changelog
  2. 2 3
      debian/copyright
  3. 75 0
      debian/patches/01_less_strict_index_tests
  4. 1 0
      debian/patches/series

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+dulwich (0.8.5-2) UNRELEASED; urgency=low
+
+  * Make index tests a bit less strict, fixes FTBFS on some systems.
+    Closes: #666328
+
+ -- Jelmer Vernooij <jelmer@debian.org>  Mon, 02 Apr 2012 12:49:38 +0200
+
 dulwich (0.8.5-1) unstable; urgency=low
 
   * Install upstream changelog.

+ 2 - 3
debian/copyright

@@ -6,17 +6,16 @@ Debianized-By: Jelmer Vernooij <jelmer@debian.org>
 Debianized-Date: Tue, 13 Jan 2009 16:56:47 +0100
 
 Files: *
-Copyright: 2005 Linus Torvalds
 Copyright: 2007 James Westby <jw+debian@jameswestby.net>
 Copyright: 2007-2012 Jelmer Vernooij <jelmer@samba.org>
 Copyright: 2008 John Carr <john.carr@unrouted.co.uk>
 Copyright: 2010 Google, Inc. <dborowitz@google.com>
 License: GPL-2+
- On Debian systems the full text of the GNU General Public License version 2 
+ On Debian systems the full text of the GNU General Public License version 2
  can be found in the `/usr/share/common-licenses/GPL-2' file.
 
 Files: debian/*
 Copyright: 2009-2012 Jelmer Vernooij <jelmer@debian.org>
 License: GPL-2+
- On Debian systems the full text of the GNU General Public License version 2 
+ On Debian systems the full text of the GNU General Public License version 2
  can be found in the `/usr/share/common-licenses/GPL-2' file.

+ 75 - 0
debian/patches/01_less_strict_index_tests

@@ -0,0 +1,75 @@
+Description: Make index entry tests a little bit less strict, to cope with
+ slightly different behaviour on various platforms.
+Origin: commit, revision id: git-v1:c398d692d1ba6c5fcee26383bfc78f73875de20b
+Author: Jelmer Vernooij <jelmer@samba.org>
+Last-Update: 2012-04-02
+Applied-Upstream: merged in revision 1044
+X-Bzr-Revision-Id: git-v1:c398d692d1ba6c5fcee26383bfc78f73875de20b
+
+=== modified file 'dulwich/tests/test_index.py'
+--- old/dulwich/tests/test_index.py	2012-04-02 10:29:11 +0000
++++ new/dulwich/tests/test_index.py	2012-04-02 10:37:42 +0000
+@@ -26,7 +26,6 @@
+ import shutil
+ import stat
+ import struct
+-import sys
+ import tempfile
+ 
+ from dulwich.index import (
+@@ -216,11 +215,7 @@
+ 
+ class BuildIndexTests(TestCase):
+ 
+-    def assertReasonableIndexEntry(self, index_entry, 
+-            time, mode, filesize, sha):
+-        delta = 1000000
+-        self.assertEquals(index_entry[0], index_entry[1])  # ctime and atime
+-        self.assertTrue(index_entry[0] > time - delta)
++    def assertReasonableIndexEntry(self, index_entry, mode, filesize, sha):
+         self.assertEquals(index_entry[4], mode)  # mode
+         self.assertEquals(index_entry[7], filesize)  # filesize
+         self.assertEquals(index_entry[8], sha)  # sha
+@@ -280,8 +275,6 @@
+                 repo.object_store, tree.id)
+ 
+         # Verify index entries
+-        import time
+-        ctime = time.time()
+         index = repo.open_index()
+         self.assertEquals(len(index), 4)
+ 
+@@ -289,28 +282,28 @@
+         apath = os.path.join(repo.path, 'a')
+         self.assertTrue(os.path.exists(apath))
+         self.assertReasonableIndexEntry(index['a'],
+-            ctime, stat.S_IFREG | 0644, 6, filea.id)
++            stat.S_IFREG | 0644, 6, filea.id)
+         self.assertFileContents(apath, 'file a')
+ 
+         # fileb
+         bpath = os.path.join(repo.path, 'b')
+         self.assertTrue(os.path.exists(bpath))
+         self.assertReasonableIndexEntry(index['b'],
+-            ctime, stat.S_IFREG | 0644, 6, fileb.id)
++            stat.S_IFREG | 0644, 6, fileb.id)
+         self.assertFileContents(bpath, 'file b')
+ 
+         # filed
+         dpath = os.path.join(repo.path, 'c', 'd')
+         self.assertTrue(os.path.exists(dpath))
+         self.assertReasonableIndexEntry(index['c/d'], 
+-            ctime, stat.S_IFREG | 0644, 6, filed.id)
++            stat.S_IFREG | 0644, 6, filed.id)
+         self.assertFileContents(dpath, 'file d')
+ 
+         # symlink to d
+         epath = os.path.join(repo.path, 'c', 'e')
+         self.assertTrue(os.path.exists(epath))
+         self.assertReasonableIndexEntry(index['c/e'], 
+-            ctime, stat.S_IFLNK, 1, filee.id)
++            stat.S_IFLNK, 1, filee.id)
+         self.assertFileContents(epath, 'd', symlink=True)
+ 
+         # Verify no extra files
+

+ 1 - 0
debian/patches/series

@@ -0,0 +1 @@
+01_less_strict_index_tests