Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/bcgsc/pori_python into b…
Browse files Browse the repository at this point in the history
…ugfix/KBDEV-1231_wildtype_mismatch
  • Loading branch information
dustinbleile committed Jul 30, 2024
2 parents cb59d0b + 275dd99 commit d044b82
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions tests/test_ipr/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def loaded_reports(tmp_path_factory) -> Generator:
{"analysisRole": "expression (disease)", "name": "1"},
{"analysisRole": "expression (primary site)", "name": "2"},
{"analysisRole": "expression (biopsy site)", "name": "3"},
{"analysisRole": "expression (internal pancancer cohort)", "name": "4"},
{
"analysisRole": "expression (internal pancancer cohort)",
"name": "4",
},
],
"patientId": patient_id,
"project": "TEST",
Expand Down Expand Up @@ -80,10 +83,20 @@ def loaded_reports(tmp_path_factory) -> Generator:
),
"kbDiseaseMatch": "colorectal cancer",
}
json_file.write_text(json.dumps(json_contents, allow_nan=False))
json_file.write_text(
json.dumps(
json_contents,
allow_nan=False,
)
)

json_contents["patientId"] = async_patient_id
async_json_file.write_text(json.dumps(json_contents, allow_nan=False))
async_json_file.write_text(
json.dumps(
json_contents,
allow_nan=False,
)
)

argslist = [
"ipr",
Expand Down Expand Up @@ -122,12 +135,11 @@ def loaded_reports(tmp_path_factory) -> Generator:
loaded_report = ipr_conn.get(uri=f"reports?searchText={patient_id}")
async_loaded_report = ipr_conn.get(uri=f"reports?searchText={async_patient_id}")

loaded_reports = {
loaded_reports_result = {
"sync": (patient_id, loaded_report),
"async": (async_patient_id, async_loaded_report),
}
yield loaded_reports

yield loaded_reports_result
ipr_conn.delete(uri=f"reports/{loaded_report['reports'][0]['ident']}")
ipr_conn.delete(uri=f"reports/{async_loaded_report['reports'][0]['ident']}")

Expand All @@ -154,6 +166,12 @@ def compare_sections(section1, section2):
item[subitem].pop(key, None)
if isinstance(item[subitem], list):
[subsubitem.pop(key, None) for subsubitem in item[subitem]]
if isinstance(section1, list):
section2_items = [str(item) for item in section2]
section2_items.sort()
section1_items = [str(item) for item in section1]
section1_items.sort()
return str(section2_items) == str(section1_items)
return str(section1) == str(section2)


Expand Down

0 comments on commit d044b82

Please sign in to comment.