diff --git a/modules/t/analysis.t b/modules/t/analysis.t index eaa678dae01cd09c62913cde87e1d98cf4d82821..f182a8797092ead75c1684d4713d80f3a1165b68 100644 --- a/modules/t/analysis.t +++ b/modules/t/analysis.t @@ -17,9 +17,9 @@ ok(1); my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok( $multi ); -$multi->hide( "core", "analysis", "analysis_description" ); +$multi->hide( "patch", "analysis", "analysis_description", "gene" ); -my $db = $multi->get_DBAdaptor( "core" ); +my $db = $multi->get_DBAdaptor( "patch" ); ok($db); @@ -54,7 +54,7 @@ my $analysis_out = $analysis_ad->fetch_by_logic_name('dummy_analysis'); ok($analysis_out); -ok($analysis_out->db eq 'dummy'); +is($analysis_out->db, 'dummy', "Db matches"); ok( check_methods( $analysis_out, "db", "db_file", "dbID", "compare", "logic_name", "parameters", "gff_source", "gff_feature", @@ -62,7 +62,7 @@ ok( check_methods( $analysis_out, "db", "db_file", "dbID", "compare", "program", "db_version", "adaptor", "display_label", "displayable", "web_data" )); -ok( $analysis_out->description eq "some funny description" ); +is( $analysis_out->description, "some funny description", "Funny description matches" ); # try updating existing description $analysis->logic_name("new_dummy"); @@ -73,11 +73,11 @@ $analysis->web_data("blahblah"); my $dbID = $analysis->dbID(); $analysis_ad->update($analysis); my $analysis_updated = $analysis_ad->fetch_by_dbID($dbID); -ok($analysis_updated->logic_name() eq "new_dummy"); -ok($analysis_updated->description() eq "new description"); -ok($analysis_updated->display_label() eq "new label"); -ok($analysis_updated->displayable() eq 0); -ok($analysis_updated->web_data() eq "blahblah"); +is($analysis_updated->logic_name(), "new_dummy", "Logic name is correct"); +is($analysis_updated->description(), "new description", "Description is correct"); +is($analysis_updated->display_label(), "new label", "Label is correct"); +is($analysis_updated->displayable(), 0, "Displayable is correct"); +is($analysis_updated->web_data(), "blahblah", "Web data is correct"); # now try updating analysis that has no existing description $analysis = Bio::EnsEMBL::Analysis->new(); @@ -89,8 +89,12 @@ $dbID = $analysis->dbID(); $analysis->description("updated description"); $analysis_ad->update($analysis); $analysis_updated = $analysis_ad->fetch_by_dbID($dbID); -ok($analysis_updated->description() eq "updated description"); -ok( count_rows( $db, "analysis_description" ) == 2 ); +is($analysis_updated->description(), "updated description", "Description matches the update"); +is_rows(2, $db, "analysis_description"); + +# Fetch all analyses for a feature class +my @analyses = $analysis_ad->fetch_all_by_feature_class('Gene'); +is(scalar(@analyses), 1, "Found 1 analysis for genes");