File: egquery.t

package info (click to toggle)
bioperl 1.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 40,768 kB
  • ctags: 12,005
  • sloc: perl: 174,299; xml: 13,923; sh: 1,941; lisp: 1,803; asm: 109; makefile: 53
file content (45 lines) | stat: -rw-r--r-- 1,418 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*-Perl-*- Test Harness script for Bioperl
# $Id: egquery.t 15112 2008-12-08 18:12:38Z sendu $
#

use strict;
use warnings;

BEGIN {
    use lib '.';
	use Bio::Root::Test;
	
	test_begin(-tests => 19,
			   -requires_module => 'XML::Simple');
	
    use_ok('Bio::Tools::EUtilities');
}

# Normal esearch
my $eutil = Bio::Tools::EUtilities->new(
    -eutil      => 'egquery',
    -file       => test_input_file('eutils','egquery.xml'));

is($eutil->get_db, 'pubmed', 'get_db');
is($eutil->get_database, 'pubmed', 'get_database');
is(scalar($eutil->get_databases), 35, 'get_databases');
is($eutil->get_term, 'Notch AND Mus musculus','get_term');

## eveything else undef or 0
is ($eutil->get_count('pubmed'), 1803, 'get_count');
is ($eutil->get_count('protein'), 534, 'get_count');
is ($eutil->get_count('cdd'), 0, 'get_count');

my @qs = $eutil->get_GlobalQueries;
is(scalar(@qs), 35, 'get_GlobalQueries');
is($qs[2]->get_term, 'Notch AND Mus musculus', 'get_term');
is($qs[2]->get_database, 'journals', 'get_term');
is($qs[2]->get_count, 0, 'get_term');
is($qs[2]->get_status, 'Term or Database is not found', 'get_term');
is($qs[2]->get_menu_name, 'Journals', 'get_term');

is($qs[20]->get_term, 'Notch AND Mus musculus', 'get_term');
is($qs[20]->get_database, 'unists', 'get_term');
is($qs[20]->get_count, 61, 'get_term');
is($qs[20]->get_status, 'Ok', 'get_term');
is($qs[20]->get_menu_name, 'UniSTS', 'get_term');