|
40 | 40 |
|
41 | 41 |
|
42 | 42 | from tests.helpers.constants import ( |
| 43 | + TEST_ACC_SCORESET_VARIANT_MAPPING_SCAFFOLD, |
43 | 44 | TEST_CLINGEN_SUBMISSION_RESPONSE, |
44 | 45 | TEST_CLINGEN_SUBMISSION_BAD_RESQUEST_RESPONSE, |
45 | 46 | TEST_CLINGEN_SUBMISSION_UNAUTHORIZED_RESPONSE, |
|
48 | 49 | TEST_MINIMAL_ACC_SCORESET, |
49 | 50 | TEST_MINIMAL_EXPERIMENT, |
50 | 51 | TEST_MINIMAL_SEQ_SCORESET, |
51 | | - TEST_VARIANT_MAPPING_SCAFFOLD, |
| 52 | + TEST_SEQ_SCORESET_VARIANT_MAPPING_SCAFFOLD, |
52 | 53 | VALID_NT_ACCESSION, |
53 | 54 | TEST_VALID_PRE_MAPPED_VRS_ALLELE_VRS1_X, |
54 | 55 | TEST_VALID_PRE_MAPPED_VRS_ALLELE_VRS2_X, |
@@ -150,10 +151,13 @@ async def sanitize_mapping_queue(standalone_worker_context, score_set): |
150 | 151 | assert int(queued_job.decode("utf-8")) == score_set.id |
151 | 152 |
|
152 | 153 |
|
153 | | -async def setup_mapping_output(async_client, session, score_set, empty=False): |
| 154 | +async def setup_mapping_output(async_client, session, score_set, score_set_is_seq_based=True, empty=False): |
154 | 155 | score_set_response = await async_client.get(f"/api/v1/score-sets/{score_set.urn}") |
155 | 156 |
|
156 | | - mapping_output = deepcopy(TEST_VARIANT_MAPPING_SCAFFOLD) |
| 157 | + if score_set_is_seq_based: |
| 158 | + mapping_output = deepcopy(TEST_SEQ_SCORESET_VARIANT_MAPPING_SCAFFOLD) |
| 159 | + else: |
| 160 | + mapping_output = deepcopy(TEST_ACC_SCORESET_VARIANT_MAPPING_SCAFFOLD) |
157 | 161 | mapping_output["metadata"] = score_set_response.json() |
158 | 162 |
|
159 | 163 | if empty: |
@@ -477,11 +481,12 @@ async def test_create_variants_for_score_set_enqueues_manager_and_successful_map |
477 | 481 | arq_worker, |
478 | 482 | arq_redis, |
479 | 483 | ): |
| 484 | + score_set_is_seq = all(["targetSequence" in target for target in input_score_set["targetGenes"]]) |
480 | 485 | score_set_urn, scores, counts = await setup_records_and_files(async_client, data_files, input_score_set) |
481 | 486 | score_set = session.scalars(select(ScoreSetDbModel).where(ScoreSetDbModel.urn == score_set_urn)).one() |
482 | 487 |
|
483 | 488 | async def dummy_mapping_job(): |
484 | | - return await setup_mapping_output(async_client, session, score_set) |
| 489 | + return await setup_mapping_output(async_client, session, score_set, score_set_is_seq) |
485 | 490 |
|
486 | 491 | async def dummy_submission_job(): |
487 | 492 | return [TEST_CLINGEN_SUBMISSION_RESPONSE, None] |
@@ -511,7 +516,7 @@ async def dummy_linking_job(): |
511 | 516 | await arq_worker.run_check() |
512 | 517 |
|
513 | 518 | # Call data provider _get_transcript method if this is an accession based score set, otherwise do not. |
514 | | - if all(["targetSequence" in target for target in input_score_set["targetGenes"]]): |
| 519 | + if score_set_is_seq: |
515 | 520 | hdp.assert_not_called() |
516 | 521 | else: |
517 | 522 | hdp.assert_called_once() |
|
0 commit comments