From 6e1bf7d89e156efb96f219b57214faabe983a8ce Mon Sep 17 00:00:00 2001 From: Debian Med Packaging Team Date: Mon, 19 Feb 2018 10:11:17 +0000 Subject: [PATCH] exclude_tests_accessing_remote_http Gbp-Pq: Name exclude_tests_accessing_remote_http.patch --- save/pysam_test2.6.py | 55 --------------------------- tests/AlignmentFile_test.py | 75 ------------------------------------- tests/tabix_test.py | 60 ----------------------------- 3 files changed, 190 deletions(-) diff --git a/save/pysam_test2.6.py b/save/pysam_test2.6.py index eb4848a..476b361 100755 --- a/save/pysam_test2.6.py +++ b/save/pysam_test2.6.py @@ -1284,61 +1284,6 @@ class TestDoubleFetch(unittest.TestCase): samfile1.fetch( until_eof = True )): self.assertEqual( a.compare( b), 0 ) -class TestRemoteFileFTP(unittest.TestCase): - '''test remote access. - - ''' - - # Need to find an ftp server without password on standard - # port. - - url = "ftp://ftp.sanger.ac.uk/pub/rd/humanSequences/CV.bam" - region = "1:1-1000" - - def testFTPView( self ): - return - result = pysam.view( self.url, self.region ) - self.assertEqual( len(result), 36 ) - - def testFTPFetch( self ): - return - samfile = pysam.Samfile(self.url, "rb") - result = list(samfile.fetch( region = self.region )) - 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 = "ex1.bam" - - def testView( self ): - samfile_local = pysam.Samfile(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 ): - samfile = pysam.Samfile(self.url, "rb") - result = list(samfile.fetch( region = self.region )) - samfile_local = pysam.Samfile(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 ): - samfile = pysam.Samfile(self.url, "rb") - result = list(samfile.fetch()) - samfile_local = pysam.Samfile(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 ) diff --git a/tests/AlignmentFile_test.py b/tests/AlignmentFile_test.py index 03a3e7f..a684fb8 100644 --- a/tests/AlignmentFile_test.py +++ b/tests/AlignmentFile_test.py @@ -1559,81 +1559,6 @@ class TestDoubleFetchCRAMWithReference(TestDoubleFetchBAM): reference_filename = os.path.join(BAM_DATADIR, 'ex1.fa') -class TestRemoteFileFTP(unittest.TestCase): - - '''test remote access. - - ''' - - # Need to find an ftp server without password on standard - # port. - - url = "ftp://ftp.sanger.ac.uk/pub/rd/humanSequences/CV.bam" - region = "1:1-1000" - - def testFTPView(self): - return - if not checkURL(self.url): - return - - result = pysam.samtools.view(self.url, self.region) - self.assertEqual(len(result), 36) - - def testFTPFetch(self): - return - if not checkURL(self.url): - return - - samfile = pysam.AlignmentFile(self.url, "rb") - result = list(samfile.fetch(region=self.region)) - 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(BAM_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.samtools.view(self.url, self.region) - self.assertEqual(len(result.splitlines()), len(ref)) - - def testFetch(self): - if not checkURL(self.url): - return - - with pysam.AlignmentFile(self.url, "rb") as samfile: - result = list(samfile.fetch(region=self.region)) - - with pysam.AlignmentFile(self.local, "rb") as samfile_local: - 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 - - with pysam.AlignmentFile(self.url, "rb") as samfile: - result = list(samfile.fetch()) - - with pysam.AlignmentFile(self.local, "rb") as samfile_local: - 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) diff --git a/tests/tabix_test.py b/tests/tabix_test.py index 013ff86..ac4d0bd 100644 --- a/tests/tabix_test.py +++ b/tests/tabix_test.py @@ -1039,66 +1039,6 @@ for vcf_file in vcf_files: globals()[n] = type(n, (TestVCFFromVariantFile,), dict(filename=vcf_file,)) -class TestRemoteFileHTTP(unittest.TestCase): - - url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/example.gtf.gz" - region = "chr1:1-1000" - local = os.path.join(TABIX_DATADIR, "example.gtf.gz") - - def setUp(self): - if not pysam.config.HAVE_LIBCURL or not checkURL(self.url): - self.remote_file = None - else: - self.remote_file = pysam.TabixFile(self.url, "r") - - self.local_file = pysam.TabixFile(self.local, "r") - - def tearDown(self): - if self.remote_file is None: - return - - self.remote_file.close() - self.local_file.close() - - def testFetchAll(self): - if self.remote_file is None: - return - - remote_result = list(self.remote_file.fetch()) - local_result = list(self.local_file.fetch()) - - self.assertEqual(len(remote_result), len(local_result)) - for x, y in zip(remote_result, local_result): - self.assertEqual(x, y) - - def testHeader(self): - if self.remote_file is None: - return - - self.assertEqual(list(self.local_file.header), []) - - -class TestRemoteFileHTTPWithHeader(TestRemoteFileHTTP): - - url = "http://genserv.anat.ox.ac.uk/downloads/pysam/test/example_comments.gtf.gz" - region = "chr1:1-1000" - local = os.path.join(TABIX_DATADIR, "example_comments.gtf.gz") - - def setUp(self): - if not pysam.config.HAVE_LIBCURL or not checkURL(self.url): - self.remote_file = None - else: - self.remote_file = pysam.TabixFile(self.url, "r") - self.local_file = pysam.TabixFile(self.local, "r") - - def testHeader(self): - if self.remote_file is None: - return - - self.assertEqual(list(self.local_file.header), ["# comment at start"]) - self.assertEqual(list(self.local_file.header), self.remote_file.header) - - class TestIndexArgument(unittest.TestCase): filename_src = os.path.join(TABIX_DATADIR, "example.vcf.gz") -- 2.30.2