From a31609c6c97d2b4229b305e18ff42419e0af5010 Mon Sep 17 00:00:00 2001
From: Glenn Proctor <gp1@sanger.ac.uk>
Date: Fri, 23 Sep 2005 08:57:14 +0000
Subject: [PATCH] Added tests for coding_transcript() and coding_gene()

---
 modules/t/regulatoryFactor.t | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/modules/t/regulatoryFactor.t b/modules/t/regulatoryFactor.t
index e36a8f6340..d670ae932d 100644
--- a/modules/t/regulatoryFactor.t
+++ b/modules/t/regulatoryFactor.t
@@ -1,5 +1,6 @@
 use strict;
 use Bio::EnsEMBL::Test::TestUtils;
+use Bio::EnsEMBL::Test::MultiTestDB;
 
 use Bio::EnsEMBL::RegulatoryFactor;
 
@@ -10,6 +11,13 @@ BEGIN { $| = 1;
 
 my $verbose = 0;
 
+# get a core DBAdaptor and a RegualtoryFactorAdaptor
+#
+my $multi = Bio::EnsEMBL::Test::MultiTestDB->new;
+my $dba = $multi->get_DBAdaptor("core");
+my $factor_adaptor = $dba->get_RegulatoryFactorAdaptor();
+
+
 #
 # Test constructor
 #
@@ -25,3 +33,12 @@ ok($rm->type eq 'promoter');
 
 ok(test_getter_setter($rm,'name','Fred'));
 ok(test_getter_setter($rm,'type','miRNA_target'));
+
+
+# test coding_transcript & gene
+my $factor = $factor_adaptor->fetch_by_dbID(1);
+my $transcript = $factor->coding_transcript();
+ok($transcript->dbID() == 21716);
+$factor = $factor_adaptor->fetch_by_dbID(5);
+my $gene = $factor->coding_gene();
+ok($gene->dbID() == 18271);
-- 
GitLab