Fix some failing tests
authorAfif Elghraoui <afif@ghraoui.name>
Thu, 10 Mar 2016 07:35:17 +0000 (23:35 -0800)
committerAfif Elghraoui <afif@ghraoui.name>
Thu, 10 Mar 2016 07:35:25 +0000 (23:35 -0800)
These are mostly ones that require network access that are not
properly handled.

debian/patches/compile-test.patch [new file with mode: 0644]
debian/patches/disable-tests-requiring-network.patch
debian/patches/series

diff --git a/debian/patches/compile-test.patch b/debian/patches/compile-test.patch
new file mode 100644 (file)
index 0000000..d8f1ffc
--- /dev/null
@@ -0,0 +1,15 @@
+Description: Fix compile-test
+Author: Afif Elghraoui <afif@debian.org>
+Forwarded: no
+Last-Update: 2016-03-09
+--- python-pysam.orig/tests/compile_test.py
++++ python-pysam/tests/compile_test.py
+@@ -15,7 +15,7 @@
+ import pyximport
+-pyximport.install(build_in_temp=False)
++pyximport.install(build_in_temp=True)
+ import _compile_test
+ import unittest
index b6cf1a15ca6c2b5b8ae23ec4dce14cf0167b82ba..bc7872dfa08386fbb203993a6501c0d99259f940 100644 (file)
@@ -4,7 +4,7 @@ Forwarded: no
 Last-Update: 2015-11-13
 --- python-pysam.orig/tests/tabix_test.py
 +++ python-pysam/tests/tabix_test.py
-@@ -1124,7 +1124,8 @@
+@@ -1124,11 +1124,12 @@
      local = os.path.join(DATADIR, "example.gtf.gz")
  
      def setUp(self):
@@ -14,7 +14,12 @@ Last-Update: 2015-11-13
          self.local_file = pysam.TabixFile(self.local, "r")
  
      def testFetchAll(self):
-@@ -1139,11 +1140,12 @@
+-        if not checkURL(self.url):
++        if checkURL(self.url) == False:
+             return
+         remote_result = list(self.remote_file.fetch())
+@@ -1139,14 +1140,15 @@
              self.assertEqual(x, y)
  
      def testHeader(self):
@@ -31,4 +36,54 @@ Last-Update: 2015-11-13
 +                              "header")
  
      def tearDown(self):
-         self.remote_file.close()
+-        self.remote_file.close()
++#        self.remote_file.close()
+         self.local_file.close()
+--- python-pysam.orig/tests/AlignmentFile_test.py
++++ python-pysam/tests/AlignmentFile_test.py
+@@ -2466,12 +2466,16 @@
+             filepath_index=os.path.join(DATADIR, 'ex1.cram.crai'))
+     def testRemoteExplicitIndexBAM(self):
+-        samfile = pysam.AlignmentFile(
+-            "http://genserv.anat.ox.ac.uk/downloads/pysam/test/noindex.bam",
+-            "rb",
+-            filepath_index=os.path.join(DATADIR, 'ex1.bam.bai'))
++        url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/noindex.bam"
++        if checkURL(url):
++            samfile = pysam.AlignmentFile(
++                url,
++                "rb",
++                filepath_index=os.path.join(DATADIR, 'ex1.bam.bai'))
+-        samfile.fetch("chr1")
++            samfile.fetch("chr1")
++        else:
++            pass
+ class TestVerbosity(unittest.TestCase):
+--- python-pysam.orig/tests/faidx_test.py
++++ python-pysam/tests/faidx_test.py
+@@ -173,12 +173,13 @@
+     def testFTPView(self):
+-        if not checkURL(self.url):
+-            return
+-        f = pysam.Fastafile(self.url)
+-        self.assertEqual(
+-            len(f.fetch("chr1", 0, 1000)),
+-            1000)
++        if checkURL(self.url):
++            f = pysam.Fastafile(self.url)
++            self.assertEqual(
++                len(f.fetch("chr1", 0, 1000)),
++                1000)
++        else:
++            return True
+ if __name__ == "__main__":
index 2e0c2eaf53712d469a28b49ab47b843a68094a9e..917fbdcaa56e02a986d85cb92ed2ed7a1daa990a 100644 (file)
@@ -1,3 +1,4 @@
 external-htslib.patch
 disable-tests-requiring-network.patch
 rpath.patch
+compile-test.patch