Example #1
0
 def test_do_gunzip(self):
     'test do_gunzip'
     zipfile = testutil.datafile('test.gz')
     outfile = testutil.tempdatafile('test4.out')
     do_gunzip(zipfile, outfile)
     h = testutil.get_file_md5(outfile)
     self.assertEqual(h.hexdigest(), '1db5a21a01ba465fd26c3203d6589b0e')
Example #2
0
 def test_run_gunzip(self):
     'test uncompress_file gunzip'
     zipfile = testutil.datafile('test.gz')
     outfile = testutil.tempdatafile('test3.out')
     uncompress_file(zipfile, newpath=outfile)
     h = testutil.get_file_md5(outfile)
     self.assertEqual(h.hexdigest(), '1db5a21a01ba465fd26c3203d6589b0e')
Example #3
0
 def test_do_unzip(self):
     'test do_unzip'
     zipfile = testutil.datafile('test.zip')
     outfile = testutil.tempdatafile('test2.out')
     do_unzip(zipfile, outfile, singleFile=True)
     h = testutil.get_file_md5(outfile)
     self.assertEqual(h.hexdigest(), '12ada4c51ccb4c7277c16f1a3c000b90')
Example #4
0
 def test_run_unzip(self):
     'test uncompress_file unzip'
     zipfile = testutil.datafile('test.zip')
     outfile = testutil.tempdatafile('test.out')
     uncompress_file(zipfile, newpath=outfile, singleFile=True)
     h = testutil.get_file_md5(outfile)
     self.assertEqual(h.hexdigest(), '12ada4c51ccb4c7277c16f1a3c000b90')
Example #5
0
 def test_do_gunzip(self):
     "test do_gunzip"
     zipfile = testutil.datafile("test.gz")
     outfile = testutil.tempdatafile("test4.out")
     do_gunzip(zipfile, outfile)
     h = testutil.get_file_md5(outfile)
     self.assertEqual(h.hexdigest(), "1db5a21a01ba465fd26c3203d6589b0e")
Example #6
0
    def test_download(self): 
        "Downloading of gzipped file using pygr.Data"
        
        url = SourceURL('http://www.doe-mbi.ucla.edu/~leec/test.gz')
        url.__doc__ = 'test download'

        worldbase.add_resource('Bio.Test.Download1', url)
        worldbase.commit()

        # performs the download            
        fpath = worldbase.Bio.Test.Download1()
        h = testutil.get_file_md5(fpath)
        self.assertEqual(h.hexdigest(), 'f95656496c5182d6cff9a56153c9db73')
        os.remove(fpath)
Example #7
0
    def test_download(self):
        "Downloading of gzipped file using pygr.Data"

        url = SourceURL('http://www.doe-mbi.ucla.edu/~leec/test.gz')
        url.__doc__ = 'test download'

        pygr.Data.addResource('Bio.Test.Download1', url)
        pygr.Data.save()

        # performs the download
        fpath = pygr.Data.Bio.Test.Download1()
        h = testutil.get_file_md5(fpath)
        self.assertEqual(h.hexdigest(), 'f95656496c5182d6cff9a56153c9db73')
        os.remove(fpath)
Example #8
0
    def test_download(self):
        "Downloading of gzipped file using metabase"

        url = SourceURL("http://www.doe-mbi.ucla.edu/~leec/test.gz")
        url.__doc__ = "test download"

        self.metabase.add_resource("Bio.Test.Download1", url)
        self.metabase.commit()

        # performs the download
        fpath = self.pygrData.Bio.Test.Download1()
        h = testutil.get_file_md5(fpath)
        self.assertEqual(h.hexdigest(), "f95656496c5182d6cff9a56153c9db73")
        os.remove(fpath)