diff --git a/tests/conftest.py b/tests/conftest.py index 3bbee11..9f1c65b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -13,7 +13,9 @@ def test_data_bed(): @pytest.fixture def test_data_bedset(): s = "test_string" - return {"name": s, "bedset_tar_archive_path": {"path": s, "title": s}} + return {"name": s, "bedset_means": { + "exon_frequency": 271, + "exon_percentage": 0.081,}} @pytest.fixture diff --git a/tests/data/config.yaml b/tests/data/config.yaml index 3ae10f4..d890fff 100644 --- a/tests/data/config.yaml +++ b/tests/data/config.yaml @@ -11,6 +11,7 @@ path: bedstat_dir: bedstat_output bedbuncher_dir: bedbuncher_output remote_url_base: null + region2vec: "add/path/here" server: host: 0.0.0.0 port: 8000 diff --git a/tests/test_bbconf.py b/tests/test_bbconf.py index e3a135b..244d697 100644 --- a/tests/test_bbconf.py +++ b/tests/test_bbconf.py @@ -73,13 +73,8 @@ def test_reporting_relationships(self, cfg_pth, test_data_bed, test_data_bedset) with ContextManagerDBTesting(DB_URL): bbc = BedBaseConf(get_bedbase_cfg(cfg=cfg_pth)) bbc.bed.report(record_identifier="bed1", values=test_data_bed) - bed_id = bbc.bed.retrieve(record_identifier="bed1", result_identifier="id") bbc.bedset.report(record_identifier="bedset1", values=test_data_bedset) - bedset_id = bbc.bedset.retrieve( - record_identifier="bedset1", result_identifier="id" - ) - bbc.report_relationship(bedfile_id=bed_id, bedset_id=bedset_id) - print("a") + bbc.report_relationship(bedfile_record_id="bed1", bedset_record_id="bedset1") def test_cant_remove_record_if_in_reltable( self, cfg_pth, test_data_bed, test_data_bedset @@ -87,12 +82,8 @@ def test_cant_remove_record_if_in_reltable( with ContextManagerDBTesting(DB_URL): bbc = BedBaseConf(get_bedbase_cfg(cfg=cfg_pth)) bbc.bed.report(record_identifier="bed1", values=test_data_bed) - bed_id = bbc.bed.retrieve(record_identifier="bed1", result_identifier="id") bbc.bedset.report(record_identifier="bedset1", values=test_data_bedset) - bedset_id = bbc.bedset.retrieve( - record_identifier="bedset1", result_identifier="id" - ) - bbc.report_relationship(bedfile_id=bed_id, bedset_id=bedset_id) + bbc.report_relationship(bedfile_record_id="bed1", bedset_record_id="bedset1") with pytest.raises(IntegrityError): bbc.bed.remove(record_identifier="bed1") with pytest.raises(IntegrityError): @@ -103,11 +94,7 @@ def test_select(self, cfg_pth, test_data_bed, test_data_bedset): bbc = BedBaseConf(get_bedbase_cfg(cfg=cfg_pth)) bbc.bed.report(record_identifier="bed1", values=test_data_bed) bbc.bedset.report(record_identifier="bedset1", values=test_data_bedset) - bedset_id = bbc.bedset.retrieve( - record_identifier="bedset1", result_identifier="id" - ) - bed_id = bbc.bed.retrieve(record_identifier="bed1", result_identifier="id") - bbc.report_relationship(bedfile_id=bed_id, bedset_id=bedset_id) + bbc.report_relationship(bedfile_record_id="bed1", bedset_record_id="bedset1") unique_bedfiles = bbc.select_unique(table_name="bedfile__sample") assert unique_bedfiles[0].record_identifier == "bed1" @@ -121,12 +108,8 @@ def test_removal(self, cfg_pth, test_data_bed, test_data_bedset): bbc = BedBaseConf(get_bedbase_cfg(cfg=cfg_pth)) bbc.bed.report(record_identifier="bed1", values=test_data_bed) bbc.bedset.report(record_identifier="bedset1", values=test_data_bedset) - bedset_id = bbc.bedset.retrieve( - record_identifier="bedset1", result_identifier="id" - ) - bed_id = bbc.bed.retrieve(record_identifier="bed1", result_identifier="id") - bbc.report_relationship(bedfile_id=bed_id, bedset_id=bedset_id) - bbc.remove_relationship(bedset_id=bedset_id, bedfile_ids=[bed_id]) + bbc.report_relationship(bedfile_record_id="bed1", bedset_record_id="bedset1",) + bbc.remove_relationship(bedset_record_id="bedset1", bedfile_record_id=["bed1"]) ori_cnt = bbc.bed.record_count bbc.bed.remove(record_identifier="bed1") assert ori_cnt - 1 == bbc.bed.record_count @@ -139,6 +122,6 @@ def test_config_variables_are_set(self, cfg_pth, test_data_bed, test_data_bedset bbc = BedBaseConf(get_bedbase_cfg(cfg=cfg_pth)) print(bbc.config["qdrant"]["host"]) - assert bbc.config["qdrant"]["host"] == "test_localhost" + assert bbc.config["qdrant"]["host"] == "localhost" assert bbc.config["path"]["region2vec"] is not None assert bbc.config["database"]["host"] in ["localhost", "127.0.0.1"]