annotate t/lib/utilsTest.pm @ 2:be504ccbc41c draft default tip

master branch Updating with tag :CI_COMMIT_TAG - - Fxx
author fgiacomoni
date Wed, 30 Nov 2022 16:14:27 +0000
parents 7c9269bded0e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
1 package utilsTest ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
2
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
3 use diagnostics; # this gives you more debugging information
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
4 use warnings; # this warns you of bad practices
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
5 use strict; # this prevents silly errors
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
6 use Exporter ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
7 use Carp ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
8
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
9 use Data::Dumper ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
10
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
11 our $VERSION = "1.0";
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
12 our @ISA = qw(Exporter);
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
13 our @EXPORT = qw( getHttpFileVersionTest getHttpFileTest unzipFileTest);
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
14 our %EXPORT_TAGS = ( ALL => [qw( getHttpFileVersionTest getHttpFileTest unzipFileTest)] );
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
15
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
16 use lib '/Users/fgiacomoni/Inra/labs/perl/downloader-bank-hmdb/lib' ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
17 use utils qw( :ALL ) ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
18
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
19
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
20 sub getHttpFileVersionTest {
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
21 my ($url) = @_ ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
22 my $oObject = utils->new() ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
23 my ($version) = $oObject->getHttpFileVersion($url) ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
24 # print Dumper $version ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
25 return ($version) ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
26 }
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
27
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
28 sub getHttpFileTest {
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
29 my ($url, $filename) = @_ ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
30 my $oObject = utils->new() ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
31 my ($file) = $oObject->getHttpFile($url, $filename) ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
32 # print Dumper $version ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
33 return ($file) ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
34 }
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
35
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
36 sub unzipFileTest {
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
37 my ($archive, $filePath, $fileName) = @_ ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
38 my $oObject = utils->new() ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
39 $oObject->unzipFile($archive, $filePath, $fileName) ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
40 # print Dumper $version ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
41 return (1) ;
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
42 }
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
43
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
44
7c9269bded0e Init repository for [downloader_bank_hmdb]
fgiacomoni
parents:
diff changeset
45 1 ;