1 # -*-Perl-*- Test Harness script for Bioperl
9 test_begin(-tests => 12,
10 -requires_modules => [qw(IO::String
12 HTTP::Request::Common)],
13 -requires_networking => 1);
16 my $verbose = test_debug();
19 my ($id, $class) = @_;
20 print "###################### $class ####################################\n" if $verbose;
22 ok defined( my $gb = $class->new('-verbose' => $verbose,
24 '-retrievaltype' => 'tempfile') ), "defined for $class";
26 if ($class eq 'Bio::DB::SwissProt') {
27 test_skip(-tests => 1, -requires_module => 'Data::Stag');
31 eval { $seq = $gb->get_Seq_by_id($id) };
32 if ($@ || !defined $seq) {
33 ok 1, "error or undef for $class";
36 ok 0, "failure for $class";
39 my @classes = qw( Bio::DB::BioFetch Bio::DB::GenBank Bio::DB::GenPept
40 Bio::DB::SwissProt Bio::DB::RefSeq Bio::DB::EMBL );
42 my $id = 'XXX111'; # nonsense id
44 ## This is really stupid since many of this modules are not longer
45 ## part of this distribution. However, they are split over many
46 ## distributions and we don't want to have this test code duplicated
47 ## all over the place. We should instead have this a Bio::Test module
48 ## but that's work. See bioperl-live issue #290
49 for my $class (@classes) {
51 eval "require $class";
52 skip "failed to use $class (guessing it's not available)", 2 if $@;