Skip to content
Snippets Groups Projects
Commit e48421a3 authored by Marek Szuba's avatar Marek Szuba
Browse files

RNAProduct: extend seq() tests

1. Since, like transcript() and unlike most getters, seq() potentially
triggers database lookups, put all its tests near transcript ones();

2. Make sure everything is prepared so that running test_getter_setter()
on seq() works in local-only mode;

3. Add a test checking for an exception being thrown in the event of
seq() neither having a local sequence nor being able to retrieve one
from the database;

4. Add an online test.
parent 3584199d
No related branches found
No related tags found
2 merge requests!371Add support for mature RNA products of transcripts (e.g. MicroRNA) to the API and schema,!371Add support for mature RNA products of transcripts (e.g. MicroRNA) to the API and schema
......@@ -82,7 +82,6 @@ ok(test_getter_setter($rp, 'dbID', 3), 'Test getter/setter dbID()');
ok(test_getter_setter($rp, 'version', 13), 'Test getter/setter version()');
ok(test_getter_setter($rp, 'created_date', time()), 'Test getter/setter created_date()');
ok(test_getter_setter($rp, 'modified_date', time()), 'Test getter/setter modified_date()');
ok(test_getter_setter($rp, 'seq', 'AATTGGCC'), 'Test getter/setter seq()');
subtest 'Test stable_id_version() functionality' => sub {
ok(test_getter_setter($rp, 'stable_id_version', 3.14),
......@@ -118,10 +117,12 @@ subtest 'display_id() functionality' => sub {
};
{
dies_ok(sub { $rp->seq() }, 'Sequence getter dies if neither local nor DB data is available');
# Again, assume test_getter_setter() cleans up after itself
my $dummy_sequence = 'CGATCCGGAAAA';
$rp->seq($dummy_sequence);
is($rp->length(), length($dummy_sequence), 'Check if length() returns correct value');
ok(test_getter_setter($rp, 'seq', 'AACCGGTT'), 'Test getter/setter seq()');
}
{
......@@ -198,6 +199,8 @@ ok($rp, 'Can fetch RNAProduct by stable ID');
# to make sure new_fast() call all of these fetch methods use does what it
# is supposed to do.
is($rp->seq(), 'AAAAACCCAGGAATCACCTGGA', 'Can retrieve associated sequence');
# Do not check any data inside the Transcript object, it is not our job to
# check database consistency. Just check that we do get something back.
isnt($rp->transcript(), undef, 'Can retrieve associated Transcript object');
......
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