exclude_tests_accessing_remote_http
authorDebian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Mon, 19 Feb 2018 10:11:17 +0000 (10:11 +0000)
committerGraham Inggs <ginggs@debian.org>
Mon, 19 Feb 2018 10:11:17 +0000 (10:11 +0000)
Gbp-Pq: Name exclude_tests_accessing_remote_http.patch

save/pysam_test2.6.py
tests/AlignmentFile_test.py
tests/tabix_test.py

index eb4848a1950eb283b066089603aa374bae3cf023..476b36177f9356aac5944c285893f60107f3f0eb 100755 (executable)
@@ -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 )
index 03a3e7f14130134df11aeeb0784000c2a590d693..a684fb8fa2499ec88815d5b4f56b8f3393e4cd75 100644 (file)
@@ -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)
index 013ff8683aa43f620e9085b88862ccc58b656b90..ac4d0bd6472f34b81a18447eee7db8ef53221431 100644 (file)
@@ -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")