1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 16,
11 -requires_modules => [qw(IO::String
13 HTTP::Request::Common)],
14 -requires_networking => 1);
16 use_ok('Bio::DB::EMBL');
19 my $verbose = test_debug();
24 $seq = $seqio = undef;
27 ok defined($db = Bio::DB::EMBL->new(-verbose=>$verbose));
28 ok(defined($seq = $db->get_Seq_by_acc('J00522')));
29 is( $seq->length, 408);
30 ok defined ($db->request_format('fasta'));
32 eval {ok(defined($seq = $db->get_Seq_by_acc('J02231')))};
33 skip('could not connect to embl',2) if $@;
34 like( $seq->id, qr/J02231/);
35 is( $seq->length, 200);
36 ok( defined($db = Bio::DB::EMBL->new(-verbose=>$verbose,
37 -retrievaltype => 'tempfile')));
38 eval {ok(defined($seqio = $db->get_Stream_by_id(['AEE33958'])))};
39 skip('could not connect to embl',2) if $@;
40 undef $db; # testing to see if we can remove gb
41 ok( defined($seq = $seqio->next_seq()));
42 cmp_ok( $seq->length, '>=', 1);
45 $seq = $seqio = undef;
48 $db = Bio::DB::EMBL->new(-verbose => $verbose,
49 -retrievaltype => 'tempfile',
52 eval{ok( defined($seqio = $db->get_Stream_by_acc(['J00522 AF303112 J02231'])))};
53 skip('could not connect to embl',3) if $@;
55 # don't assume anything about the order of the sequences
56 while ( my $s = $seqio->next_seq ) {
57 my ($type,$x,$name) = split(/\|/,$s->display_id);
58 $seqs{$x} = $s->length;
60 is($seqs{'J00522'},408);
61 is($seqs{'AF303112'},1611);
62 is($seqs{'J02231'},200);