1
# -*-Perl-*- Test Harness script for Bioperl
2
# $Id: SeqHound.t 15112 2008-12-08 18:12:38Z sendu $
10
test_begin(-tests => 15,
11
-requires_modules => [qw(IO::String LWP::UserAgent)],
12
-requires_networking => 1);
14
use_ok('Bio::DB::SeqHound');
18
unlink $Bio::DB::SeqHound::LOGFILENAME if -f $Bio::DB::SeqHound::LOGFILENAME;
21
my $verbose = test_debug();
26
$seq = $seqio = undef;
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);
47
$seq = $seqio = undef;
50
$db = Bio::DB::SeqHound->new(-verbose => $verbose,
51
-retrievaltype => 'tempfile',
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);