def test_index_missing_application(): """Test calling index without applying application""" from snakemakelib.bio.ngs.db.cloudbiolinux import index config = { "bio.ngs.settings": {"db": {"build": "hg19", "build_config": None, "ref": "foo.fa"}}, "bio.ngs.align.bwa": {"index": index}, } bwa_cfg = config["bio.ngs.align.bwa"] with pytest.raises(TypeError): index(ref=config["bio.ngs.settings"]["db"]["ref"], index=bwa_cfg["index"])
def test_cloudbiolinux_import(): """Test that importing cloudbiolinux changes db.index""" from snakemakelib.bio.ngs.db import index assert "foo.fa" == index("foo.fa", "bar", index="foo.fa") import snakemakelib.bio.ngs.db.cloudbiolinux from snakemakelib.bio.ngs.db import index assert "../bar/foo.fa" == snakemakelib.bio.ngs.db.index("foo.fa", "bar") assert "../bar/foo.fa" == index("foo.fa", "bar") assert "../bar/foo.fa" == snakemakelib.bio.ngs.db.cloudbiolinux.index("foo.fa", "bar")
def test_index(self): """Test getting the index for a given application""" config = BaseConfig({'bio.ngs.settings' : {'db' : {'build' : 'hg19', 'build_config' : None, 'ref' : self.ref}}, 'bio.ngs.align.bwa': {'index' : ""}}) cfg = config['bio.ngs.settings'] bwa_cfg = config['bio.ngs.align.bwa'] bwa_cfg['index'] = index(ref= cfg['db']['ref'], index=bwa_cfg['index'], application="bwa") self.assertEqual(os.path.normpath(bwa_cfg['index']), os.path.abspath( os.path.join(os.curdir, "bwa", "reference")))
def test_index_missing_application(self): """Test calling index without applying application""" config = BaseConfig({'bio.ngs.settings' : {'db' : {'build' : 'hg19', 'build_config' : None, 'ref' : self.ref}}, 'bio.ngs.align.bwa': {'index' : index}}) bwa_cfg = config['bio.ngs.align.bwa'] index(ref= config['bio.ngs.settings']['db']['ref'], index=bwa_cfg['index'])
def test_index(): assert "foo.fa" == index("foo.fa", "bar")