Sopma.t: Added -requires_networking requirement up front (in case
[bioperl-live.git] / t / Tools / Analysis / Protein / Sopma.t
blobcb61c0e9aca920f4f2784e3b22559881c9afd748
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {
7     use lib '.';
8     use Bio::Root::Test;
10     test_begin(-tests => 0,
11                -requires_modules => [qw(IO::String
12                                         LWP::UserAgent)]);
13                -requires_networking => 1);
15     use_ok('Bio::PrimarySeq');
16     use_ok('Bio::Tools::Analysis::Protein::Sopma');
19 my $verbose = test_debug();
21 ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);
23 my $seq = Bio::PrimarySeq->new(
24     -seq => 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS',
25     -display_id => 'test2'
27 ok $tool = Bio::Tools::Analysis::Protein::Sopma->new( -seq=>$seq,
28                                                      #-verbose => $verbose,
29                                                       -window_width => 15);
31 SKIP: {
32     ok $tool->run();
33     skip "Tool was terminated by some error: problem connecting to server?", 11 if $tool->status eq 'TERMINATED_BY_ERROR';
35     ok my $raw    = $tool->result('');
36     ok my $parsed = $tool->result('parsed');
37     is ($parsed->[0]{'helix'}, '102');
38     ok my @res  = $tool->result('Bio::SeqFeatureI');
39     ok my $meta = $tool->result('meta', "ww15");
41     ok $tool->window_width(21);
42     ok $tool->clear();
43     ok $tool->run;
44     ok my $meta2 = $tool->result('meta', "ww21");
46     SKIP: {
47         test_skip(-tests => 2, -requires_module => 'Bio::Seq::Meta::Array');
48         is $meta->named_submeta_text('Sopma_helix|ww15',1,2), '102 195';
49         is $meta->seq, 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS';
50     }