start fixing test for multi cat phenotype upload.
[sgn.git] / t / unit_fixture / CXGN / Bulk / unigene_converter.t
blob67d8297f39dc19012fc0d1f34b5b6bb93c67b699
1 use strict;
2 use warnings;
3 use Test::More;
4 use File::Temp;
6 use lib 't/lib';
7 use SGN::Test::WWW::Mechanize skip_cgi => 1;
9 # this thing is really basically a controller, so will test it like
10 # one
11 use_ok 'CXGN::Bulk::UnigeneConverter';
13 my $mech = SGN::Test::WWW::Mechanize->new;
14 $mech->with_test_level( local => sub {
16     my $tempdir = File::Temp->newdir;
17     my $params = {};
18     $params->{idType} = "unigene_convert";
19     $params->{ids} = "SGN-U243120 SGN-U243522";
20     $params->{dbc} = $mech->context->dbc->dbh;
21     $params->{tempdir} = "$tempdir";
23     # Testing constructor.
24     my $bulk = CXGN::Bulk::UnigeneConverter->new($params);
26     is($bulk->{idType}, "unigene_convert", "idType ok");
27     is($bulk->{ids}, "SGN-U243120 SGN-U243522", "id input string ok");
29     # Testing process_parameters method.
30     my $pp = $bulk->process_parameters();
32     is($pp, 1, "parameters are ok (process_parameters returned 1)");
34     is_deeply( $bulk->{ids}, [243120, 243522], "id list is ok" );
36     # Testing process_ids method.
37     $bulk->process_ids();
38 });
40 done_testing;