* add tests that check trucated sequence length matches the qual data
[bioperl-live.git] / t / RemoteDB / SeqRead_fail.t
blobc540b0a2c5c0ab51638cf0457545c22850de2cc3
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN { 
7         use lib '.';
8     use Bio::Root::Test;
9     
10     test_begin(-tests => 18,
11                            -requires_modules => [qw(IO::String
12                                                                             LWP::UserAgent
13                                                                                 HTTP::Request::Common)],
14                            -requires_networking => 1);
15         
16         use_ok('Bio::DB::GenBank');
17         use_ok('Bio::DB::GenPept');
18         use_ok('Bio::DB::SwissProt');
19         use_ok('Bio::DB::RefSeq');
20         use_ok('Bio::DB::EMBL');
21         use_ok('Bio::DB::BioFetch');
24 my $verbose = test_debug();
26 sub fetch {
27     my ($id, $class) = @_;
28     print "###################### $class  ####################################\n" if $verbose;
29     my $seq;
30     ok defined( my $gb = $class->new('-verbose'=>$verbose,
31                                                                          '-delay'=>0,
32                                                                          '-retrievaltype' => 'tempfile') ), "defined for $class";
33     eval { $seq = $gb->get_Seq_by_id($id) };
34     if ($@ || !defined $seq) {
35                 ok 1, "error or undef for $class";
36                 return;
37     }
38     ok 0, "failure for $class";
41 my @classes = qw( Bio::DB::BioFetch Bio::DB::GenBank Bio::DB::GenPept
42                   Bio::DB::SwissProt Bio::DB::RefSeq Bio::DB::EMBL );
44 my $id = 'XXX111';  # nonsense id
46 for (@classes) {
47     fetch($id, $_);