Add tests for memory leaks and weaken for Issue #81
[bioperl-live.git] / t / RemoteDB / EntrezGene.t
blobeaffa047601b651f1888e4f9569cd73780a01e68
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 => 8,
11                            -requires_modules => [qw(IO::String
12                                                                             LWP::UserAgent
13                                                                                 HTTP::Request::Common
14                                         Bio::ASN1::EntrezGene)
15                                         ],
16                            -requires_networking => 1);
17         use_ok('Bio::DB::EntrezGene');
20 my ($gb, $seq, $seqio);
23 # Bio::DB::EntrezGene
25 SKIP: {
26         test_skip(-tests => 7);
27     ok $gb = Bio::DB::EntrezGene->new(-retrievaltype => 'tempfile', -delay => 0);
28     eval {$seqio = $gb->get_Stream_by_id([2,3064]);};
29     skip "Couldn't connect to Entrez with Bio::DB::EntrezGene. Skipping those tests", 6 if $@;
30     $seq = $seqio->next_seq;
31     is $seq->display_id, "A2M";
32     is $seq->accession_number, 2;
33     $seq = $seqio->next_seq;
34     is $seq->display_id, "HTT";
35     is $seq->accession_number, 3064;
36     eval {$seq = $gb->get_Seq_by_id(6099);};
37     skip "Couldn't connect to Entrez with Bio::DB::EntrezGene. Skipping those tests", 2 if $@;
38     is $seq->display_id, "RP";
39     is $seq->accession_number, 6099;