From 2f339d9d1f831b73174690e97dfb5a2f2f471f87 Mon Sep 17 00:00:00 2001 From: jessicaw9910 Date: Fri, 3 May 2024 13:20:44 -0400 Subject: [PATCH] updated tests for cbioportal error --- tests/test_databases.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/test_databases.py b/tests/test_databases.py index 2572723..eb121f1 100644 --- a/tests/test_databases.py +++ b/tests/test_databases.py @@ -35,13 +35,23 @@ def test_config(): def test_cbioportal(): - from missense_kinase_toolkit.databases import cbioportal + from missense_kinase_toolkit.databases import config, cbioportal + + config.set_cbioportal_instance("www.cbioportal.org") # test that the function to set the API key for cBioPortal works - cbioportal.cBioPortal()._set_api_key() + # cbioportal.cBioPortal()._set_api_key() # test that the function to query the cBioPortal API works - cbioportal.cBioPortal().query_cbioportal_api() + cbioportal_instance = cbioportal.cBioPortal() + + # test that server status is up + assert cbioportal_instance._cbioportal.Server_running_status.getServerStatusUsingGET().response().result["status"] == "UP" + + # test that Zehir cohort is available + list_studies = cbioportal_instance._cbioportal.Studies.getAllStudiesUsingGET().result() + list_study_ids = [study.studyId for study in list_studies] + assert "msk_impact_2017" in list_study_ids def test_io_utils():