[med-svn] [python-skbio] 03/04: Add gzip patch (REMOVE @ 0.4.2)

Kevin Murray daube-guest at moszumanska.debian.org
Wed Feb 17 21:45:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

daube-guest pushed a commit to branch master
in repository python-skbio.

commit 7aa3cf66aa6e08529d21a35f1616f9eba8d19c51
Author: Kevin Murray <spam at kdmurray.id.au>
Date:   Wed Feb 17 13:42:31 2016 -0800

    Add gzip patch (REMOVE @ 0.4.2)
---
 debian/patches/gzip-fix | 67 +++++++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series   |  1 +
 2 files changed, 68 insertions(+)

diff --git a/debian/patches/gzip-fix b/debian/patches/gzip-fix
new file mode 100644
index 0000000..ca4a151
--- /dev/null
+++ b/debian/patches/gzip-fix
@@ -0,0 +1,67 @@
+diff --git a/skbio/io/tests/test_util.py b/skbio/io/tests/test_util.py
+index 88b4480..adcc8a9 100644
+--- a/skbio/io/tests/test_util.py
++++ b/skbio/io/tests/test_util.py
+@@ -320,6 +320,13 @@ def check_open_state_contents(self, file, contents, is_binary,
+             self.assertTrue(result.closed)
+             self.check_closed(file, True)
+ 
++    def compare_gzip_file_contents(self, a, b):
++        # The first 10 bytes of a gzip header include a timestamp. The header
++        # can be followed by other "volatile" metadata, so only compare gzip
++        # footers (last 8 bytes) which contain a CRC-32 checksum and the length
++        # of the uncompressed data.
++        self.assertEqual(a[-8:], b[-8:])
++
+     def test_open_binary(self):
+         self.check_open_state_contents(self.binary_file, self.binary_contents,
+                                        True, encoding='binary',
+@@ -332,9 +339,8 @@ def test_open_gzip(self):
+         self.check_open_state_contents(self.gzip_file, self.text_contents,
+                                        False, compression='gzip')
+ 
+-        # The first 10 bytes of a gzip header include a timestamp, so skip.
+-        self.assertEqual(self.get_contents(self.gzip_file)[10:],
+-                         self.gzip_contents[10:])
++        self.compare_gzip_file_contents(self.get_contents(self.gzip_file),
++                                        self.gzip_contents)
+ 
+     def test_open_bz2(self):
+         self.check_open_state_contents(self.bz2_file, self.text_contents,
+@@ -355,9 +361,9 @@ def test_open_gzip_encoding(self):
+                                        self.decoded_contents, False,
+                                        compression='gzip', encoding='big5')
+ 
+-        # The first 10 bytes of a gzip header include a timestamp, so skip.
+-        self.assertEqual(self.get_contents(self.gzip_encoded_file)[10:],
+-                         self.gzip_encoded_contents[10:])
++        self.compare_gzip_file_contents(
++            self.get_contents(self.gzip_encoded_file),
++            self.gzip_encoded_contents)
+ 
+     def test_open_bz2_encoding(self):
+         self.check_open_state_contents(self.bz2_encoded_file,
+@@ -482,18 +488,17 @@ def test_open_gzip(self):
+         self.check_open_state_contents(self.gzip_file, self.text_contents,
+                                        False, compression='gzip')
+ 
+-        # The first 10 bytes of a gzip header include a timestamp, so skip.
+-        self.assertEqual(self.get_contents(self.gzip_file)[10:],
+-                         self.gzip_contents[23:])
++        self.compare_gzip_file_contents(self.get_contents(self.gzip_file),
++                                        self.gzip_contents)
+ 
+     def test_open_gzip_encoding(self):
+         self.check_open_state_contents(self.gzip_encoded_file,
+                                        self.decoded_contents, False,
+                                        compression='gzip', encoding='big5')
+ 
+-        # The first 10 bytes of a gzip header include a timestamp, so skip.
+-        self.assertEqual(self.get_contents(self.gzip_encoded_file)[10:],
+-                         self.gzip_encoded_contents[20:])
++        self.compare_gzip_file_contents(
++            self.get_contents(self.gzip_encoded_file),
++            self.gzip_encoded_contents)
+ 
+ 
+ class TestReadBufferedReader(ReadableBinarySourceTests, ReadableSourceTest):
diff --git a/debian/patches/series b/debian/patches/series
index a40c4be..aefa9b3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
 0004-Don-t-build-pdf-figures.patch
 0005-Fix-test-failure-patch-from-upstream.patch
 0006-Remove-broken-test-on-upstream-suggestion.patch
+gzip-fix

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-skbio.git



More information about the debian-med-commit mailing list