Skip to content
Snippets Groups Projects
Commit 0df84302 authored by Glenn Proctor's avatar Glenn Proctor
Browse files

Renamed from *motif*

parent 8054e841
No related branches found
No related tags found
No related merge requests found
use strict;
use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::RegulatoryMotif;
BEGIN { $| = 1;
use Test;
plan tests => 7;
}
my $verbose = 0;
#
# Test constructor
#
my $rm = Bio::EnsEMBL::RegulatoryMotif->new(-NAME => 'Joe',
-TYPE => 'promoter');
ok($rm);
ok(ref($rm));
ok($rm->isa('Bio::EnsEMBL::RegulatoryMotif'));
ok($rm->name eq 'Joe');
ok($rm->type eq 'promoter');
ok(test_getter_setter($rm,'name','Fred'));
ok(test_getter_setter($rm,'type','miRNA_target'));
use strict;
use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Test::MultiTestDB;
BEGIN { $| = 1;
use Test;
plan tests => 11;
}
my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new;
my $db = $multi_db->get_DBAdaptor('core');
my $verbose = 0;
# Test Creation
my $rma = $db->get_RegulatoryMotifAdaptor();
ok(ref($rma) && $rma->isa('Bio::EnsEMBL::DBSQL::RegulatoryMotifAdaptor'));
#
# Test fetch_by_dbID
#
my $rm = $rma->fetch_by_dbID(1);
ok($rm->name() eq 'motif1');
ok($rm->dbID == 1);
ok($rm->type eq 'miRNA_target');
#
# Test fetch_by_name
#
$rm = $rma->fetch_by_name('motif1');
ok($rm->name() eq 'motif1');
ok($rm->dbID() == 1);
ok($rm->type() eq 'miRNA_target');
#
# Test fetch_all_by_type
#
ok(@{$rma->fetch_all_by_type('promoter')} == 2);
#
# Test store
#
$multi_db->save('core', 'regulatory_motif');
$rm = Bio::EnsEMBL::RegulatoryMotif->new(-NAME => 'test_store',
-TYPE => 'promoter');
$rma->store($rm);
ok($rm->dbID && $rm->adaptor());
$rm = $rma->fetch_by_dbID($rm->dbID);
ok($rm->name eq 'test_store');
ok($rm->type eq 'promoter');
$multi_db->restore('core', 'regulatory_motif');
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