Skip to content
Snippets Groups Projects
Commit 03e7d821 authored by Andy Yates's avatar Andy Yates
Browse files

adding internal tests to ensure the logic of fetch by ids works post modification

parent 895f64ca
No related branches found
No related tags found
No related merge requests found
......@@ -15,12 +15,29 @@ is($count, 20, 'Checking generic_count for protein_coding genes returns expected
# fetch_all_by_dbID_list tests
{
my $gene_list = $gene_adaptor->_uncached_fetch_all_by_id_list([qw(ENSG00000101321 ENSG00000101346 ENSG00000101367)],undef,"stable_id");
ok(scalar(@$gene_list) == 3, "Basic uncached fetch by list");
}
{
my $gene_list = $gene_adaptor->_uncached_fetch_all_by_id_list([qw(ENSG00000101321 ENSG00000101346 ENSG00000101367)], undef, "stable_id", 0);
ok(scalar(@$gene_list) == 3, "Basic uncached fetch by list forcing numeric type to false");
}
my $gene_list = $gene_adaptor->_uncached_fetch_all_by_id_list([qw(ENSG00000101321 ENSG00000101346 ENSG00000101367)],undef,"stable_id");
ok(scalar(@$gene_list) == 3, "Basic uncached fetch by list");
# CHecking non-numeric given to a numeric means no-go
dies_ok {
$gene_list = $gene_adaptor->_uncached_fetch_all_by_id_list([qw(ENSG00000101321 ENSG00000101346 ENSG00000101367)],undef,"dbID")
} "Wrong data type for ID";
$gene_adaptor->_uncached_fetch_all_by_id_list([qw(ENSG00000101321 ENSG00000101346 ENSG00000101367)], undef, "dbID")
} "Wrong data type for dbID";
# We want the proper exception telling us that we said it was a numeric but then just
# gave it the wrong data
throws_ok {
$gene_adaptor->_uncached_fetch_all_by_id_list([qw(ENSG00000101321 ENSG00000101346 ENSG00000101367)], undef, "stable_id", 1)
} qr/You specified/, "Correct type given but forcing it to use numerics";
# Making sure we can execute an excessivly large list of IDs by splitting into multiple queries
my @ids = 1..256000;
my $id_derrived_gene_list = $gene_adaptor->_uncached_fetch_all_by_id_list(\@ids, undef, "dbID", 1);
is(scalar(@{$id_derrived_gene_list}), 20, 'Checking we get 20 genes back');
done_testing();
\ No newline at end of file
done_testing();
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