Catch failing tie'd DB_File handle
[bioperl-live.git] / t / Sopma.t
blobd60c0bc4394a232770df54d3e28571b32f51168e
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 => 16,
11                -requires_modules => [qw(IO::String LWP::UserAgent)]);
12         
13         use_ok('Bio::PrimarySeq');
14         use_ok('Bio::Tools::Analysis::Protein::Sopma');
17 my $verbose = test_debug();
19 ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);
21 my $seq = Bio::PrimarySeq->new(
22   -seq => 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS',
23   -display_id => 'test2');
24 ok $tool = Bio::Tools::Analysis::Protein::Sopma->new( -seq=>$seq,
25                                                       -window_width => 15);
27 SKIP: {
28         test_skip(-tests => 12, -requires_networking => 1);
29         
30         ok $tool->run();
31         skip "Tool was terminated by some error: problem connecting to server?", 11 if $tool->status eq 'TERMINATED_BY_ERROR';
32         
33         ok my $raw = $tool->result('');
34         ok my $parsed = $tool->result('parsed');
35         is ($parsed->[0]{'helix'}, '104');
36         ok my @res = $tool->result('Bio::SeqFeatureI');
37         ok my $meta = $tool->result('meta', "ww15");
39         ok $tool->window_width(21);
40         ok $tool->clear();
41         ok $tool->run;
42         ok my $meta2 = $tool->result('meta', "ww21");
43         
44         SKIP: {
45                 test_skip(-tests => 2, -requires_module => 'Bio::Seq::Meta::Array');
46                 is $meta->named_submeta_text('Sopma_helix|ww15',1,2), '104 195';
47                 is $meta->seq, 'MSADQRWRQDSQDSFGDSFDGDPPPPPPPPFGDSFGDGFSDRSRQDQRS';
48         }