1
1
# This is -*-Perl-*- code
2
2
## Bioperl Test Harness Script for Modules
4
# $Id: ESEfinder.t,v 1.9 2003/12/18 03:03:26 jason Exp $
4
# $Id: ESEfinder.t,v 1.13.6.5 2006/11/08 17:25:55 sendu Exp $
6
6
# Before `make install' is performed this script should be runnable with
7
7
# `make test'. After `make install' it should work as `perl test.t'
9
use vars qw($NUMTESTS $DEBUG $ERROR $METAERROR);
10
$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
10
use vars qw($NUMTESTS $DEBUG);
12
# to handle systems with no installed Test module
13
# we include the t dir (where a copy of Test.pm is located)
15
eval { require Test; };
23
plan tests => $NUMTESTS;
27
require LWP::UserAgent;
28
require Bio::WebAgent;
29
require HTML::HeadParser;
32
warn("IO::String or LWP::UserAgent not installed. This means that the module is not usable. Skipping tests");
14
$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
16
eval {require Test::More;};
36
require Bio::Seq::Meta::Array;
24
require LWP::UserAgent;
25
require Bio::WebAgent;
26
require HTML::HeadParser;
27
require HTTP::Request::Common;
39
warn ("Bio::Seq::Meta::Array not installed - will skip tests using meta sequences");
46
foreach ( $Test::ntest..$NUMTESTS) {
47
skip('unable to run all of the tests depending on web access',1);
51
exit 0 if $ERROR == 1;
55
use Bio::Tools::Analysis::DNA::ESEfinder;
30
plan skip_all => 'IO::String, LWP::UserAgent, Bio::WebAgent, HTML::HeadParser, or HTTP::Request::Common not installed. This means that the module is not usable. Skipping tests';
33
plan tests => $NUMTESTS;
36
use_ok('Bio::Tools::Analysis::DNA::ESEfinder');
37
use_ok('Data::Dumper');
38
use_ok('Bio::PrimarySeq');
66
42
#######all these tests work with 1ary seq########
67
43
my $seq = Bio::PrimarySeq->new(-id=>'bioperl',
68
44
-seq=>'atcgatgctatgcatgctatgggtgtgattcgatgcgactgttcatcgtagccccccccccccccctttt');
45
ok my $tool = Bio::Tools::Analysis::DNA::ESEfinder->new(-seq => $seq);
70
ok $tool = Bio::Tools::Analysis::DNA::ESEfinder->new(-verbose =>$verbose, -seq => $seq);
48
skip "Skipping tests which require remote servers, set BIOPERLDEBUG=1 to test", 9 unless $DEBUG;
50
skip "Could not connect to ESEfinder server, skipping those tests", 9 if $@;
73
51
ok my @res = $tool->result('Bio::SeqFeatureI');
74
53
ok my $raw = $tool->result('');
75
54
ok my $parsed = $tool->result('parsed');
76
55
ok my $meta = $tool->result('all');
77
ok ($parsed->[0][1], 41);
78
if (scalar @res > 0) {
81
skip('No network access - could not connect to ESEfinder server', 1);
83
if (!$METAERROR) { #if Bio::Seq::Meta::Array available
84
ok($meta->{'seq'}, "atcgatgctatgcatgctatgggtgtgattcgatgcgactgttcatcgtagccccccccccccccctttt" );
85
ok( $meta->named_submeta_text('ESEfinder_SRp55', 1,2), "-3.221149 -1.602223");
86
ok ($meta->seq, "atcgatgctatgcatgctatgggtgtgattcgatgcgactgttcatcgtagccccccccccccccctttt" );
89
for ( $Test::ntest..$NUMTESTS) {
90
skip("Skipping tests which require remote servers - set env variable BIOPERLDEBUG to test",1);
56
is $parsed->[0][1], 41;
58
eval {require Bio::Seq::Meta::Array;};
59
skip "Bio::Seq::Meta::Array not installed. Skipping tests using meta sequences", 3 if $@;
60
is $meta->{'seq'}, "atcgatgctatgcatgctatgggtgtgattcgatgcgactgttcatcgtagccccccccccccccctttt";
61
is $meta->named_submeta_text('ESEfinder_SRp55', 1,2), "-3.221149 -1.602223";
62
is $meta->seq, "atcgatgctatgcatgctatgggtgtgattcgatgcgactgttcatcgtagccccccccccccccctttt";