use
vars
qw($NUMTESTS $DEBUG $ERROR)
;
$DEBUG
=
$ENV
{
'BIOPERLDEBUG'
} || 0;
BEGIN {
$ERROR
= 0;
if
( $@ ) {
}
$NUMTESTS
= 8;
plan
tests
=>
$NUMTESTS
;
eval
{
};
if
( $@ ) {
warn
(
"IO::String or LWP::UserAgent not installed. This means that the module is not usable. Skipping tests\n"
);
$ERROR
= 1;
}
}
END {
foreach
(
$Test::ntest
..
$NUMTESTS
) {
skip(
'unable to complete MitoProt tests, skipping'
,1);
}
}
exit
0
if
$ERROR
== 1;
ok 1;
my
$verbose
= 0;
$verbose
= 1
if
$DEBUG
;
ok
my
$tool
= Bio::WebAgent->new(
-verbose
=>
$verbose
);
my
$seq
= Bio::PrimarySeq->new(
-seq
=>
'MSADQRWRQDSQDSFGDSFDGDSFFGSDFDGDS'
.
'DFGSDFGSDGDFGSDFGDSFGDGFSDRSRQDQRS'
,
-display_id
=>
'test2'
);
ok
$tool
= Bio::Tools::Analysis::Protein::Mitoprot->new(
-seq
=>
$seq
);
if
(
$DEBUG
) {
ok
$tool
->run ();
exit
if
$tool
->status eq
'TERMINATED_BY_ERROR'
;
ok
my
$raw
=
$tool
->result(
''
);
ok
my
$parsed
=
$tool
->result(
'parsed'
);
ok (
$parsed
->{
'charge'
}, -13);
ok
my
@res
=
$tool
->result(
'Bio::SeqFeatureI'
);
}
else
{
for
(
$Test::ntest
..
$NUMTESTS
) {
skip(
"Skipping tests which require remote servers - set env variable BIOPERLDEBUG to test"
,1);
}
}