def test_get_ensembl_account(self): """return an HostAccount with correct port""" for release in [48, "48", None]: act_new = get_ensembl_account(release=ENSEMBL_RELEASE) self.assertEqual(act_new.port, 5306) for release in [45, "45"]: act_old = get_ensembl_account(release=45) self.assertEqual(act_old.port, 3306)
def test_active_connections(self): """connecting to a database on a specified server should be done once only, but same database on a different server should be done""" ensembl_acct = get_ensembl_account(release="46") engine1 = DbConnection(account=ensembl_acct, db_name="homo_sapiens_core_46_36h") engine2 = DbConnection(account=ensembl_acct, db_name="homo_sapiens_core_46_36h") self.assertEqual(engine1, engine2)
__credits__ = ["Gavin Huttley", "hua Ying"] __license__ = "BSD" __version__ = "3.0a1" __maintainer__ = "Gavin Huttley" __email__ = "*****@*****.**" __status__ = "alpha" if "ENSEMBL_ACCOUNT" in os.environ: args = os.environ["ENSEMBL_ACCOUNT"].split() host, username, password = args[0:3] kwargs = {} if len(args) > 3: kwargs["port"] = int(args[3]) account = HostAccount(host, username, password, **kwargs) else: account = get_ensembl_account(release=ENSEMBL_RELEASE) class TestFeatureCoordLevels(TestCase): def setUp(self): self.chicken = Genome(species="chicken", release=ENSEMBL_RELEASE, account=account) def test_feature_levels(self): ChickenFeatureLevels = FeatureCoordLevels("chicken") chicken_feature_levels = ChickenFeatureLevels( feature_types=["gene", "cpg", "est"], core_db=self.chicken.CoreDb, otherfeature_db=self.chicken.OtherFeaturesDb, )
def test_pool_recycle_option(self): """excercising ability to specify a pool recycle option""" ensembl_acct = get_ensembl_account(release="56") engine1 = DbConnection(account=ensembl_acct, db_name="homo_sapiens_core_46_36h", pool_recycle=1000)