~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to t/RemoteDB/SeqHound.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*- Test Harness script for Bioperl
 
2
# $Id: SeqHound.t 15112 2008-12-08 18:12:38Z sendu $
 
3
 
 
4
use strict;
 
5
 
 
6
BEGIN {
 
7
        use lib '.';
 
8
    use Bio::Root::Test;
 
9
    
 
10
    test_begin(-tests => 15,
 
11
                           -requires_modules => [qw(IO::String LWP::UserAgent)],
 
12
                           -requires_networking => 1);
 
13
        
 
14
        use_ok('Bio::DB::SeqHound');
 
15
}
 
16
 
 
17
END {
 
18
        unlink $Bio::DB::SeqHound::LOGFILENAME if -f $Bio::DB::SeqHound::LOGFILENAME;
 
19
}
 
20
 
 
21
my $verbose = test_debug();
 
22
 
 
23
my ($db,$seq,$seqio);
 
24
# get a single seq
 
25
 
 
26
$seq = $seqio = undef;
 
27
 
 
28
SKIP: {
 
29
    $db = Bio::DB::SeqHound->new(-verbose=>$verbose);
 
30
    eval {ok(defined($seq = $db->get_Seq_by_acc('J00522')));};
 
31
        skip('Could not connect to seqhound, skipping tests', 10) if $@;
 
32
    is( $seq->length, 408); 
 
33
    ok defined ($db->request_format('fasta'));
 
34
    eval {ok(defined($seq = $db->get_Seq_by_acc('NP_862707')));};
 
35
        skip('Could not connect to seqhound, skipping tests', 7) if $@;
 
36
    is( $seq->accession, 'NP_862707');
 
37
    is( $seq->length, 227); 
 
38
    ok( defined($db = Bio::DB::SeqHound->new(-verbose=>$verbose, 
 
39
                                        -retrievaltype => 'tempfile')));
 
40
    eval {ok(defined($seqio = $db->get_Stream_by_id(['BTACHRE'])));};
 
41
        skip('Could not connect to seqhound, skipping tests', 3) if $@;
 
42
    undef $db; # testing to see if we can remove db
 
43
    ok( defined($seq = $seqio->next_seq()));
 
44
    is( $seq->length, 1621);
 
45
}
 
46
 
 
47
$seq = $seqio = undef;
 
48
 
 
49
SKIP: {
 
50
    $db = Bio::DB::SeqHound->new(-verbose => $verbose,
 
51
                            -retrievaltype => 'tempfile',
 
52
                            -format => 'genbank'
 
53
                            ); 
 
54
    eval {ok( defined($seqio = $db->get_Stream_by_acc(['J00522', 'AF303112', 'J02231'])));};
 
55
        skip('Could not connect to seqhound for batch test, skipping tests', 4) if $@;
 
56
        is($seqio->next_seq->length, 408);
 
57
    is($seqio->next_seq->length, 1611);
 
58
    is($seqio->next_seq->length, 200);
 
59
}