~ubuntu-branches/ubuntu/raring/bioperl/raring

« back to all changes in this revision

Viewing changes to t/EMBL_DB.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2008-03-18 14:44:57 UTC
  • mfrom: (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080318144457-1jjoztrvqwf0gruk
* debian/control:
  - Removed MIA Matt Hope (dopey) from the Uploaders field.
    Thank you for your work, Matt. I hope you are doing well.
  - Downgraded some recommended package to the 'Suggests' priority,
    according to the following discussion on Upstream's mail list.
    http://bioperl.org/pipermail/bioperl-l/2008-March/027379.html
    (Closes: #448890)
* debian/copyright converted to machine-readable format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# This is -*-Perl-*- code
2
2
## Bioperl Test Harness Script for Modules
3
3
##
4
 
# $Id: EMBL_DB.t,v 1.12 2002/12/02 15:38:31 jason Exp $
 
4
# $Id: EMBL_DB.t,v 1.16 2006/06/29 15:20:44 sendu Exp $
5
5
 
6
6
# Before `make install' is performed this script should be runnable with
7
7
# `make test'. After `make install' it should work as `perl test.t'
25
25
 
26
26
    $NUMTESTS = 15;
27
27
    plan tests => $NUMTESTS;
28
 
    eval { require 'IO/String.pm' };
 
28
    eval { require IO::String;
 
29
                          require HTTP::Request::Common;   };
29
30
    if( $@ ) {
30
31
        for( $Test::ntest..$NUMTESTS ) {
31
32
            skip("IO::String not installed. This means the Bio::DB::* modules are not usable. Skipping tests",1);
33
34
       $error = 1; 
34
35
    }
35
36
}
 
37
 
36
38
END { 
37
39
    foreach ( $Test::ntest..$NUMTESTS) {
38
40
        skip('unable to run all of the Biblio_biofetch tests',1);
64
66
    ok( $seq->length, 408); 
65
67
    ok defined ($db->request_format('fasta'));
66
68
    ok(defined($seq = $db->get_Seq_by_acc('J02231')));
67
 
    ok( $seq->id, qr/embl.+BUM/);
 
69
    ok( $seq->id, 'embl|J02231|J02231');
68
70
    ok( $seq->length, 200); 
69
71
    ok( defined($db = new Bio::DB::EMBL(-verbose=>$verbose, 
70
72
                                        -retrievaltype => 'tempfile')));
92
94
                            -format => 'fasta'
93
95
                            ); 
94
96
    ok( defined($seqio = $db->get_Stream_by_acc(['J00522 AF303112 J02231'])));
95
 
    ok($seqio->next_seq->length, 408);
96
 
    ok($seqio->next_seq->length, 1611);
97
 
    ok($seqio->next_seq->length, 200);
 
97
    my %seqs;
 
98
    # don't assume anything about the order of the sequences
 
99
    while ( my $s = $seqio->next_seq ) {
 
100
        my ($type,$x,$name) = split(/\|/,$s->display_id);
 
101
        $seqs{$x} = $s->length;
 
102
    }
 
103
    ok($seqs{'J00522'},408);
 
104
    ok($seqs{'AF303112'},1611);
 
105
    ok($seqs{'J02231'},200);
98
106
};
99
107
 
100
108
if ($@) {