use
vars
qw($NUMTESTS $DEBUG)
;
$DEBUG
=
$ENV
{
'BIOPERLDEBUG'
} || 0;
my
$error
;
BEGIN {
$error
= 0;
if
( $@ ) {
}
$NUMTESTS
= 13;
plan
tests
=>
$NUMTESTS
;
};
if
( $@ ) {
for
(
$Test::ntest
..
$NUMTESTS
) {
skip(
"IO::String,LWP::UserAgent, or HTTP::Request::Common not installed. This means the Bio::DB::* modules are not usable. Skipping tests"
,1);
}
$error
= 1;
}
}
END {
for
(
$Test::ntest
..
$NUMTESTS
) {
skip(
"Unable to complete RefSeq tests - set env variable BIOPERLDEBUG to test"
,1);
}
}
if
(
$error
== 1 ) {
exit
(0);
}
require
Bio::DB::RefSeq;
require
Bio::DB::GenBank;
require
Bio::DB::EMBL;
my
$testnum
;
my
$verbose
= 0;
my
(
$db
,
$seq
,
$db2
,
$seq2
,
$seqio
);
$seq
=
$seqio
=
undef
;
$verbose
= -1;
ok
$db
= new Bio::DB::GenBank(
'-verbose'
=>
$verbose
) ;
ok
$db2
= new Bio::DB::EMBL(
'-verbose'
=>
$verbose
) ;
eval
{
$seq
=
$db
->get_Seq_by_acc(
'NT_006732'
);
$seq2
=
$db2
->get_Seq_by_acc(
'NT_006732'
);
};
ok $@;
exit
unless
$DEBUG
;
eval
{
ok(
$seq
=
$db
->get_Seq_by_acc(
'NM_006732'
));
ok(
$seq
&&
$seq
->
length
eq 3775);
ok
$seq2
=
$db2
->get_Seq_by_acc(
'NM_006732'
);
ok(
$seq2
&&
$seq2
->
length
eq 3775);
};
if
($@) {
if
(
$DEBUG
) {
print
STDERR
"Warning: Couldn't connect to RefSeq with Bio::DB::RefSeq.pm!\n"
. $@;
}
exit
(0);
}
$verbose
= 0;
eval
{
ok
defined
(
$db
= new Bio::DB::RefSeq(
-verbose
=>
$verbose
));
ok(
defined
(
$seq
=
$db
->get_Seq_by_acc(
'NM_006732'
)));
ok(
$seq
->
length
, 3775);
ok
defined
(
$db
->request_format(
'fasta'
));
ok(
defined
(
$seq
=
$db
->get_Seq_by_acc(
'NM_006732'
)));
ok(
$seq
->
length
, 3775);
};
if
($@) {
if
(
$DEBUG
) {
print
STDERR
"Warning: Couldn't connect to RefSeq with Bio::DB::RefSeq.pm!\n"
. $@;
}
exit
(0);
}