Skip to content
Snippets Groups Projects
Commit 8cf11593 authored by Magali Ruffier's avatar Magali Ruffier
Browse files

added test cases for undefined objects

parent 232701d7
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,8 @@ use Test::More; ...@@ -7,7 +7,8 @@ use Test::More;
use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Attribute; use Bio::EnsEMBL::Attribute;
our $verbose = 0; our $verbose = 1;
our $clean = 0;
my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; my $multi = Bio::EnsEMBL::Test::MultiTestDB->new;
...@@ -75,6 +76,17 @@ ok($attrib->code eq 'test_code'); ...@@ -75,6 +76,17 @@ ok($attrib->code eq 'test_code');
ok($attrib->description eq 'test_desc'); ok($attrib->description eq 'test_desc');
ok($attrib->value eq 'test_value'); ok($attrib->value eq 'test_value');
@attribs = @{ $aa->fetch_all_by_MiscFeature() };
ok(@attribs == 1);
$attrib = $attribs[0];
ok($attrib->name eq 'test_name');
ok($attrib->code eq 'test_code');
ok($attrib->description eq 'test_desc');
ok($attrib->value eq 'test_value');
# #
# test the removal of this attribute # test the removal of this attribute
...@@ -98,6 +110,7 @@ ok(@attribs == 0); ...@@ -98,6 +110,7 @@ ok(@attribs == 0);
################# #################
# Slice functionality tests # Slice functionality tests
# #
...@@ -134,16 +147,16 @@ ok($count == 1); ...@@ -134,16 +147,16 @@ ok($count == 1);
# test that we can now retrieve this attribute # test that we can now retrieve this attribute
# #
@attribs = @{$aa->fetch_all_by_Slice($slice)}; @attribs = @{$aa->fetch_all_by_Slice($slice)};
ok(@attribs == 1); ok(@attribs == 1);
@attribs = @{$aa->fetch_all_by_Slice($slice,"rubbish")}; @attribs = @{$aa->fetch_all_by_Slice($slice,"rubbish")};
ok(@attribs == 0); ok(@attribs == 0);
@attribs = @{$aa->fetch_all_by_Slice($slice,"test_code2")}; @attribs = @{$aa->fetch_all_by_Slice($slice,"test_code2")};
ok(@attribs == 1); ok(@attribs == 1);
@attribs = @{$aa->fetch_all_by_Slice(undef,"test_code2")};
ok(@attribs == 1);
$attrib = $attribs[0]; $attrib = $attribs[0];
...@@ -213,6 +226,10 @@ ok($count == 1); ...@@ -213,6 +226,10 @@ ok($count == 1);
note "attribs: " . scalar(@attribs); note "attribs: " . scalar(@attribs);
ok(@attribs == 1); ok(@attribs == 1);
@attribs = @{$aa->fetch_all_by_Slice(undef)};
ok(@attribs == 1);
# #
# test the removal of this attribute # test the removal of this attribute
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment