Mercurial > repos > fgiacomoni > lipidmaps_textsearch
annotate t/wsdl_lmTest.t @ 0:e8bd49794291 draft
Init repository with last lipidmaps_textsearch master version
author | fgiacomoni |
---|---|
date | Tue, 11 Apr 2017 03:47:06 -0400 |
parents | |
children | 1276908e8fc4 |
rev | line source |
---|---|
0
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
1 #! perl |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
2 use diagnostics; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
3 use warnings; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
4 no warnings qw/void/; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
5 use strict; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
6 no strict "refs" ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
7 use Test::More qw( no_plan ); |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
8 #use Test::More tests => 29 ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
9 use FindBin ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
10 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
11 ## Specific Modules |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
12 use lib $FindBin::Bin ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
13 my $binPath = $FindBin::Bin ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
14 use lib::lmTest qw( :ALL ) ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
15 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
16 my $current_test = 0 ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
17 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
18 print "\n\t\t\t\t * * * * * * \n" ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
19 print "\t * * * - - - Test LiPIDMAPS Main script - - - * * * \n\n" ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
20 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
21 print "\n** Test $current_test build_lm_mass_query with no fam/class/subcl **\n" ; $current_test++; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
22 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
23 is( build_lm_mass_queryTest('0.5', 'NA', 'NA_1', 'NA_101'),'http://www.lipidmaps.org/data/structure/LMSDSearch.php?Mode=ProcessTextSearch&OutputColumnHeader=No&OutputMode=File&OutputType=TSV&ExactMassOffSet=0.5&ExactMass=', 'Works with no cat, no class and no subcl argvt' ) ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
24 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
25 print "\n** Test $current_test build_lm_mass_query with a fam but no class/subcl **\n" ; $current_test++; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
26 is( build_lm_mass_queryTest('0.5', 1, 'NA_1', 'NA_101'),'http://www.lipidmaps.org/data/structure/LMSDSearch.php?Mode=ProcessTextSearch&OutputColumnHeader=No&OutputMode=File&OutputType=TSV&CoreClass=1&ExactMassOffSet=0.5&ExactMass=', 'Works with a cat, but no class and no subcl argvt' ) ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
27 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
28 print "\n** Test $current_test build_lm_mass_query with a fam/class but no subcl **\n" ; $current_test++; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
29 is( build_lm_mass_queryTest('0.5', 1, 101, 'NA_101'),'http://www.lipidmaps.org/data/structure/LMSDSearch.php?Mode=ProcessTextSearch&OutputColumnHeader=No&OutputMode=File&OutputType=TSV&CoreClass=1&MainClass=101&ExactMassOffSet=0.5&ExactMass=', 'Works with a cat, a class but no subcl argvt' ) ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
30 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
31 print "\n** Test $current_test build_lm_mass_query with a fam/class/subcl **\n" ; $current_test++; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
32 is( build_lm_mass_queryTest('0.5', 1, 101, 10101),'http://www.lipidmaps.org/data/structure/LMSDSearch.php?Mode=ProcessTextSearch&OutputColumnHeader=No&OutputMode=File&OutputType=TSV&CoreClass=1&MainClass=101&SubClass=10101&ExactMassOffSet=0.5&ExactMass=', 'Works with a cat, a class and a subcl argvt' ) ; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
33 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
34 print "\n** Test $current_test round_nums with a list of float and a decimal reduction of 1 **\n" ; $current_test++; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
35 is_deeply( round_numsTest( |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
36 ['175.01', '238.19', '420.16', '780.32', '956.25', '1100.45' ], 1 ), |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
37 ['175.0', '238.2', '420.2', '780.3', '956.2', '1100.5' ], |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
38 'Method \'round_nums\' works with a list of float and return a well rounded list'); |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
39 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
40 print "\n** Test $current_test round_nums with a list of float and a decimal reduction of 0 **\n" ; $current_test++; |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
41 is_deeply( round_numsTest( |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
42 ['175.01', '238.19', '420.16', '780.32', '956.25', '1100.45', '111.6' ], 0 ), |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
43 ['175', '238', '420', '780', '956', '1100', '112' ], |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
44 'Method \'round_nums\' works with a list of float and return a well rounded list'); |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
45 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
46 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
47 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
48 |
e8bd49794291
Init repository with last lipidmaps_textsearch master version
fgiacomoni
parents:
diff
changeset
|
49 |