From 55589221e5f22bcce5183a4fbb2099b4fca6f9b5 Mon Sep 17 00:00:00 2001 From: mathieulemieux Date: Tue, 24 Oct 2023 15:21:46 -0700 Subject: [PATCH] Add tests for test_cancer_genes() --- tests/test_genes.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_genes.py b/tests/test_genes.py index ef88d14..00e391e 100644 --- a/tests/test_genes.py +++ b/tests/test_genes.py @@ -7,6 +7,7 @@ from graphkb import GraphKBConnection from graphkb.genes import ( + get_cancer_genes, get_cancer_predisposition_info, get_gene_information, get_genes_from_variant_types, @@ -22,6 +23,7 @@ CANONICAL_ONCOGENES = ["kras", "nras", "alk"] CANONICAL_TS = ["cdkn2a", "tp53"] +CANONICAL_CG = ["ercc1", "fanci", "h2bc4", "h2bc17", "acvr1b"] CANONICAL_FUSION_GENES = ["alk", "ewsr1", "fli1"] CANONICAL_STRUCTURAL_VARIANT_GENES = ["brca1", "dpyd", "pten"] CANNONICAL_THERAPY_GENES = ["erbb2", "brca2", "egfr"] @@ -112,6 +114,8 @@ def test_oncogene(conn): assert gene in names for gene in CANONICAL_TS: assert gene not in names + for gene in CANONICAL_CG: + assert gene not in names def test_tumour_supressors(conn): @@ -121,6 +125,19 @@ def test_tumour_supressors(conn): assert gene in names for gene in CANONICAL_ONCOGENES: assert gene not in names + for gene in CANONICAL_CG: + assert gene not in names + + +def test_cancer_genes(conn): + result = get_cancer_genes(conn) + names = {row["name"] for row in result} + for gene in CANONICAL_CG: + assert gene in names + for gene in CANONICAL_TS: + assert gene not in names + for gene in CANONICAL_ONCOGENES: + assert gene not in names def test_get_pharmacogenomic_info(conn):