[BUG] bug 2598
[bioperl-live.git] / t / ESEfinder.t
blob29ff2c59708f63b6b2159570b6422e5b47344f92
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {
7         use lib 't/lib';
8         use BioperlTest;
9         
10         test_begin(-tests => 13,
11                            -requires_modules => [qw(IO::String
12                                                                                 LWP::UserAgent
13                                                                                 Bio::WebAgent
14                                                                                 HTML::HeadParser
15                                                                                 HTTP::Request::Common)],
16                            -requires_networking => 1);
17         
18         use_ok('Bio::Tools::Analysis::DNA::ESEfinder');
19         use_ok('Data::Dumper');
20         use_ok('Bio::PrimarySeq');
23 #######all these tests work with 1ary seq########
24 my $seq = Bio::PrimarySeq->new(-id=>'bioperl',
25                                -seq=>'atcgatgctatgcatgctatgggtgtgattcgatgcgactgttcatcgtagccccccccccccccctttt');
26 ok my $tool = Bio::Tools::Analysis::DNA::ESEfinder->new(-seq => $seq);
28 SKIP: {
29         eval {$tool->run;};
30         skip "Could not connect to ESEfinder server, skipping those tests", 9 if $@;
31     ok my @res = $tool->result('Bio::SeqFeatureI');
32         ok @res > 0;
33     ok my $raw = $tool->result('');
34     ok my $parsed = $tool->result('parsed');
35     ok my $meta = $tool->result('all');
36     is $parsed->[0][1], 41;
37         
38         SKIP: {
39                 test_skip(-tests => 3, -requires_module => 'Bio::Seq::Meta::Array');
40                 is $meta->{'seq'}, "atcgatgctatgcatgctatgggtgtgattcgatgcgactgttcatcgtagccccccccccccccctttt";
41                 is $meta->named_submeta_text('ESEfinder_SRp55', 1,2), "-3.221149 -1.602223";
42                 is $meta->seq, "atcgatgctatgcatgctatgggtgtgattcgatgcgactgttcatcgtagccccccccccccccctttt";
43         }