Skip to content

Commit c925d21

Browse files
committed
Try fixing tests
1 parent d0fa1bc commit c925d21

3 files changed

Lines changed: 21 additions & 11 deletions

File tree

requirements/common.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
requests==2.34.0
1+
requests==2.32.4
22
urllib3==2.2.3

test_Annotation.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ def test_fake_cna():
314314
fake_gene_one_query_suite(annotations, True)
315315

316316

317+
def assert_treatments_equal(actual, expected):
318+
assert set(actual.split(',')) == set(expected.split(','))
319+
320+
317321
def check_brca2_s1882_without_cancertype(annotation, genomic_query=False):
318322
assert len(annotation) == NUMBER_OF_GC_ANNOTATION_COLUMNS if genomic_query else NUMBER_OF_ANNOTATION_COLUMNS
319323
assert annotation[(
@@ -322,12 +326,18 @@ def check_brca2_s1882_without_cancertype(annotation, genomic_query=False):
322326
NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + ONCOGENIC_INDEX) if genomic_query else ONCOGENIC_INDEX] == 'Likely Oncogenic'
323327
assert annotation[(
324328
NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + HIGHEST_LEVEL_INDEX) if genomic_query else HIGHEST_LEVEL_INDEX] == 'LEVEL_1'
325-
assert annotation[(
326-
NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_1_INDEX) if genomic_query else LEVEL_1_INDEX] == 'Olaparib,Olaparib+Bevacizumab,Rucaparib,Olaparib+Abiraterone+Prednisone,Niraparib,Talazoparib+Enzalutamide,Niraparib+Abiraterone Acetate+Prednisone'
327-
assert annotation[(
328-
NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_2_INDEX) if genomic_query else LEVEL_2_INDEX] == 'Olaparib,Rucaparib,Niraparib'
329-
assert annotation[(
330-
NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_3A_INDEX) if genomic_query else LEVEL_3A_INDEX] == 'Olaparib,Talazoparib'
329+
assert_treatments_equal(
330+
annotation[(NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_1_INDEX) if genomic_query else LEVEL_1_INDEX],
331+
'Olaparib,Olaparib+Bevacizumab,Rucaparib,Olaparib+Abiraterone+Prednisone,Niraparib,Talazoparib+Enzalutamide,Niraparib+Abiraterone Acetate+Prednisone'
332+
)
333+
assert_treatments_equal(
334+
annotation[(NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_2_INDEX) if genomic_query else LEVEL_2_INDEX],
335+
'Olaparib,Rucaparib,Niraparib'
336+
)
337+
assert_treatments_equal(
338+
annotation[(NUMBER_OF_ONCOKB_ANNOTATION_GC_COLUMNS + LEVEL_3A_INDEX) if genomic_query else LEVEL_3A_INDEX],
339+
'Olaparib,Talazoparib'
340+
)
331341

332342

333343
@pytest.mark.skipif(ONCOKB_API_TOKEN in (None, ''), reason="oncokb api token required")

test_AnnotatorCore.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ def test_resolve_query_type_for_row():
183183
def test_combined_headers():
184184
headers = get_oncokb_annotation_column_headers(False, True, MutationStatus.SOMATIC, combined_mode=True)
185185
assert 'ONCOGENIC' in headers
186-
assert 'PATHOGENIC' in headers
187-
assert 'PENETRANCE' in headers
188-
assert 'GENOMIC_INDICATOR' in headers
186+
assert 'PATHOGENIC (Germline)' in headers
187+
assert 'PENETRANCE (Germline)' in headers
188+
assert 'GENOMIC_INDICATOR (Germline)' in headers
189189
assert 'ONCOKB_HUGO_SYMBOL' in headers
190190

191191

@@ -237,7 +237,7 @@ def fake_pull_hgvsc_info(queries, include_descriptions, annotate_hotspot, mutati
237237

238238
annotated_index = header.index('ANNOTATED')
239239
oncogenic_index = header.index('ONCOGENIC')
240-
pathogenic_index = header.index('PATHOGENIC')
240+
pathogenic_index = header.index('PATHOGENIC (Germline)')
241241
assert rows[0][annotated_index] == 'True'
242242
assert rows[1][annotated_index] == 'True'
243243
assert rows[1][oncogenic_index] == ''

0 commit comments

Comments
 (0)