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

« back to all changes in this revision

Viewing changes to t/Tools/EUtilities/elink_ncheck.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: epost.t 15112 2008-12-08 18:12:38Z sendu $
 
3
 
 
4
use strict;
 
5
use warnings;
 
6
use Data::Dumper;
 
7
 
 
8
BEGIN {
 
9
    use lib '.';
 
10
        use Bio::Root::Test;
 
11
        
 
12
        test_begin(-tests => 60,
 
13
                           -requires_module => 'XML::Simple');
 
14
        
 
15
    use_ok('Bio::Tools::EUtilities');
 
16
    use_ok('Bio::Tools::EUtilities::EUtilParameters');
 
17
}
 
18
 
 
19
# check -correspondence => 0 (default) - this is set up to return the
 
20
# exact same thing as correspondece = 1, tested below)
 
21
my $eutil = Bio::Tools::EUtilities->new(
 
22
    -eutil      => 'elink',
 
23
    -file       => test_input_file('eutils','elink_ncheck.xml'));
 
24
 
 
25
isa_ok($eutil, 'Bio::Tools::EUtilities::Link');
 
26
 
 
27
# for lcheck, db are not returned (check is for external link in, not out)
 
28
is(join(',',$eutil->get_databases), '');
 
29
 
 
30
# for elinks, IDs are globbed together when called from the parser
 
31
# unless a database is specified.  Since no database is specified, all
 
32
# ids are lumped together regardless
 
33
is(join(',',$eutil->get_ids), '730439,68536103,1621261,20807972', 'get_ids');
 
34
my @ls = $eutil->get_LinkSets;
 
35
is(scalar(@ls), 4, 'uncorrelated LinkSets lump everything together');
 
36
is(join(',',$ls[1]->get_databases), '');
 
37
isa_ok($ls[0], 'Bio::Tools::EUtilities::EUtilDataI');
 
38
isa_ok($ls[0], 'Bio::Tools::EUtilities::Link::LinkSet');
 
39
 
 
40
# check data in LinkSets
 
41
is(join(',',$ls[0]->get_ids), '730439');
 
42
is(join(',',$ls[0]->get_databases), '');
 
43
is(join(',',$ls[0]->get_submitted_ids), '730439');
 
44
is($ls[0]->get_dbfrom, 'protein');
 
45
is(join(',',$ls[0]->get_link_names), '');
 
46
is($ls[0]->has_scores, 0);
 
47
is($ls[0]->has_linkout, 0);
 
48
is($ls[0]->has_neighbor, 1);
 
49
 
 
50
# no LinkInfo
 
51
my @info = $ls[0]->get_LinkInfo;
 
52
is(scalar(@info), 0);
 
53
 
 
54
my @urls = $ls[0]->get_UrlLinks;
 
55
is(scalar(@urls), 0);
 
56
 
 
57
is(join(',',$ls[1]->get_ids), '68536103');
 
58
is(join(',',$ls[1]->get_databases), '');
 
59
is(join(',',$ls[1]->get_submitted_ids), '68536103');
 
60
is(join(',',$ls[1]->get_link_names), '');
 
61
is($ls[1]->get_dbfrom, 'protein');
 
62
is($ls[1]->has_scores, 0);
 
63
is($ls[1]->has_linkout, 0);
 
64
is($ls[1]->has_neighbor, 1);
 
65
 
 
66
# no LinkInfo
 
67
@info = $ls[1]->get_LinkInfo;
 
68
is(scalar(@info), 0);
 
69
 
 
70
# no UrlLinks
 
71
@urls = $ls[1]->get_UrlLinks;
 
72
is(scalar(@urls), 0);
 
73
 
 
74
# check -correspondence => 1
 
75
$eutil = Bio::Tools::EUtilities->new(
 
76
    -eutil      => 'elink',
 
77
    -file       => test_input_file('eutils','elink_ncheck_corr.xml'));
 
78
 
 
79
isa_ok($eutil, 'Bio::Tools::EUtilities::Link');
 
80
is(join(',',$eutil->get_databases), '');
 
81
 
 
82
# for elinks, IDs are globbed together when called from the parser unless a database is specified
 
83
is(join(',',$eutil->get_ids), '1621261,68536103,20807972,730439', 'get_ids');
 
84
@ls = $eutil->get_LinkSets;
 
85
is(scalar(@ls), 4, 'correlated LinkSets separate ID data');
 
86
is(join(',',$ls[1]->get_databases), '');
 
87
isa_ok($ls[0], 'Bio::Tools::EUtilities::EUtilDataI');
 
88
isa_ok($ls[0], 'Bio::Tools::EUtilities::Link::LinkSet');
 
89
 
 
90
# check data in LinkSets
 
91
is(join(',',$ls[0]->get_ids), '1621261');
 
92
is(join(',',$ls[0]->get_databases), '');
 
93
is(join(',',$ls[0]->get_submitted_ids), '1621261');
 
94
is(join(',',$ls[0]->get_link_names), '');
 
95
is($ls[0]->get_dbfrom, 'protein');
 
96
is($ls[0]->has_scores, 0);
 
97
is($ls[0]->has_linkout, 0);
 
98
is($ls[0]->has_neighbor, 1);
 
99
 
 
100
# no LinkInfo
 
101
@info = $ls[0]->get_LinkInfo;
 
102
is(scalar(@info), 0);
 
103
 
 
104
# no UrlLinks
 
105
@urls = $ls[0]->get_UrlLinks;
 
106
is(scalar(@urls), 0);
 
107
 
 
108
# HistoryI
 
109
is($ls[0]->get_webenv, undef);
 
110
is($ls[0]->get_query_key, undef);
 
111
 
 
112
is(join(',',$ls[1]->get_ids), '68536103');
 
113
is(join(',',$ls[1]->get_databases), '');
 
114
is(join(',',$ls[1]->get_submitted_ids), '68536103');
 
115
is($ls[1]->get_dbfrom, 'protein');
 
116
is(join(',',$ls[1]->get_link_names), '');
 
117
is($ls[1]->has_scores, 0);
 
118
is($ls[1]->has_linkout, 0);
 
119
is($ls[1]->has_neighbor, 1);
 
120
 
 
121
# no LinkInfo
 
122
@info = $ls[1]->get_LinkInfo;
 
123
is(scalar(@info), 0);
 
124
 
 
125
# no UrlLinks
 
126
@urls = $ls[1]->get_UrlLinks;
 
127
is(scalar(@urls), 0);
 
128
 
 
129
# HistoryI
 
130
is($ls[1]->get_webenv, undef);
 
131
is($ls[1]->get_query_key, undef);
 
132