Catch failing tie'd DB_File handle
[bioperl-live.git] / t / ELM.t
blob9c6835480f72b0a0d2fe9a08b203793e0a28aa2a
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 => 15,
11                            -requires_modules => [qw(IO::String
12                                                                             LWP::UserAgent
13                                                                                 HTML::HeadParser)],
14                            -requires_networking => 1);
15         
16         use_ok('Bio::Tools::Analysis::Protein::ELM');
17         use_ok('Bio::SeqIO');
18         use_ok('Bio::WebAgent');
21 my $verbose = test_debug();
23 ok my $tool = Bio::WebAgent->new(-verbose =>$verbose);
25 my $seqio=Bio::SeqIO->new( -verbose => $verbose,
26                   -format => 'swiss',
27                   -file   => test_input_file('swiss.dat'));
29 my $seq = $seqio->next_seq();
30 ok $tool = Bio::Tools::Analysis::Protein::ELM->new( 
31                                         -seq=>$seq->primary_seq);
32 ok $tool->compartment(['golgi', 'er']);
33 ok my $cmp = $tool->compartment();
34 is $cmp->[1], 'GO:0005783';
35 ok $tool->species(9606);
36 is $tool->species, 9606;
38 ok $tool->run ();
39 exit if $tool->status eq 'TERMINATED_BY_ERROR';
40 ok my $raw = $tool->result('');
41 print $raw if $verbose;
42 ok my $parsed = $tool->result('parsed');
43 is $parsed->{'CLV_NDR_NDR_1'}{'locus'}[0], '54-56';
44 ok my @res = $tool->result('Bio::SeqFeatureI');