[med-svn] [python-pysam] 02/05: Replace patch for network-dependent tests
Afif Elghraoui
afif-guest at moszumanska.debian.org
Sat Nov 14 07:36:07 UTC 2015
This is an automated email from the git hooks/post-receive script.
afif-guest pushed a commit to branch master
in repository python-pysam.
commit eeec80eca5a393156ce1b323f53c3576c4d99f6a
Author: Afif Elghraoui <afif at ghraoui.name>
Date: Fri Nov 13 20:48:49 2015 -0800
Replace patch for network-dependent tests
---
.../patches/disable-tests-requiring-network.patch | 42 +++++++++++
debian/patches/series | 2 +-
debian/patches/strip_online_tests.patch | 82 ----------------------
3 files changed, 43 insertions(+), 83 deletions(-)
diff --git a/debian/patches/disable-tests-requiring-network.patch b/debian/patches/disable-tests-requiring-network.patch
new file mode 100644
index 0000000..07af1b6
--- /dev/null
+++ b/debian/patches/disable-tests-requiring-network.patch
@@ -0,0 +1,42 @@
+Description: Disable tests requiring network access
+Author: Afif Elghraoui <afif at ghraoui.name>
+Forwarded: no
+Last-Update: 2015-11-13
+--- python-pysam.orig/tests/tabix_test.py
++++ python-pysam/tests/tabix_test.py
+@@ -504,7 +504,7 @@
+ b = copy.copy(a)
+ self.assertEqual(a, b)
+
+-
++
+
+ class TestIterators(unittest.TestCase):
+
+@@ -944,7 +944,8 @@
+ local = os.path.join(DATADIR, "example.gtf.gz")
+
+ def setUp(self):
+- self.remote_file = pysam.TabixFile(self.url, "r")
++ if checkURL(self.url):
++ self.remote_file = pysam.TabixFile(self.url, "r")
+ self.local_file = pysam.TabixFile(self.local, "r")
+
+ def testFetchAll(self):
+@@ -960,11 +961,12 @@
+
+ def testHeader(self):
+ self.assertEqual(list(self.local_file.header), [])
+- self.assertRaises(AttributeError,
+- getattr,
+- self.remote_file,
+- "header")
+
++ if checkURL(self.url):
++ self.assertRaises(AttributeError,
++ getattr,
++ self.remote_file,
++ "header")
+
+ class TestIndexArgument(unittest.TestCase):
+
diff --git a/debian/patches/series b/debian/patches/series
index 639025c..d7785a3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,4 @@
change-htslib-statement-to-link-to-debian
adding-include-hts-dirs
ignore-htslib-dir.patch
-strip_online_tests.patch
+disable-tests-requiring-network.patch
diff --git a/debian/patches/strip_online_tests.patch b/debian/patches/strip_online_tests.patch
deleted file mode 100644
index c2bc21f..0000000
--- a/debian/patches/strip_online_tests.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Last-Update: Tue, 21 Jul 2015 11:39:00 +0200
-Description: Remove tests relying on online connection from test suite
-
---- a/tests/AlignmentFile_test.py
-+++ b/tests/AlignmentFile_test.py
-@@ -1730,49 +1730,6 @@ class TestRemoteFileFTP(unittest.TestCas
- self.assertEqual(len(result), 36)
-
-
--class TestRemoteFileHTTP(unittest.TestCase):
--
-- url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/ex1.bam"
-- region = "chr1:1-1000"
-- local = os.path.join(DATADIR, "ex1.bam")
--
-- def testView(self):
-- if not checkURL(self.url):
-- return
--
-- samfile_local = pysam.AlignmentFile(self.local, "rb")
-- ref = list(samfile_local.fetch(region=self.region))
--
-- result = pysam.view(self.url, self.region)
-- self.assertEqual(len(result), len(ref))
--
-- def testFetch(self):
-- if not checkURL(self.url):
-- return
--
-- samfile = pysam.AlignmentFile(self.url, "rb")
-- result = list(samfile.fetch(region=self.region))
-- samfile_local = pysam.AlignmentFile(self.local, "rb")
-- ref = list(samfile_local.fetch(region=self.region))
--
-- self.assertEqual(len(ref), len(result))
-- for x, y in zip(result, ref):
-- self.assertEqual(x.compare(y), 0)
--
-- def testFetchAll(self):
-- if not checkURL(self.url):
-- return
--
-- samfile = pysam.AlignmentFile(self.url, "rb")
-- result = list(samfile.fetch())
-- samfile_local = pysam.AlignmentFile(self.local, "rb")
-- ref = list(samfile_local.fetch())
--
-- self.assertEqual(len(ref), len(result))
-- for x, y in zip(result, ref):
-- self.assertEqual(x.compare(y), 0)
--
--
- class TestLargeOptValues(unittest.TestCase):
-
- ints = (65536, 214748, 2147484, 2147483647)
---- a/tests/tabix_test.py
-+++ b/tests/tabix_test.py
-@@ -927,23 +927,6 @@ for vcf_file in vcf_files:
- ############################################################################
-
-
--class TestRemoteFileHTTP(unittest.TestCase):
--
-- url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/example_htslib.gtf.gz"
-- region = "chr1:1-1000"
-- local = os.path.join(DATADIR, "example.gtf.gz")
--
-- def testFetchAll(self):
-- remote_file = pysam.TabixFile(self.url, "r")
-- remote_result = list(remote_file.fetch())
-- local_file = pysam.TabixFile(self.local, "r")
-- local_result = list(local_file.fetch())
--
-- self.assertEqual(len(remote_result), len(local_result))
-- for x, y in zip(remote_result, local_result):
-- self.assertEqual(x, y)
--
--
- class TestIndexArgument(unittest.TestCase):
-
- filename_src = os.path.join(DATADIR, "example.vcf.gz")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-pysam.git
More information about the debian-med-commit
mailing list