-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
105 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"cases": [ | ||
{ | ||
"cohorts": null, | ||
"name": "B", | ||
"panels": null, | ||
"priority": "FAIL", | ||
"samples": [ | ||
{ | ||
"age_at_sampling": "17.2", | ||
"application": "PANKTTR100", | ||
"capture_kit": "GMCKsolid", | ||
"comment": "This is a sample comment", | ||
"concentration_ng_ul": null, | ||
"container": "96 well plate", | ||
"container_name": "BalsamicPlate", | ||
"control": "FAIL", | ||
"data_analysis": null, | ||
"data_delivery": null, | ||
"elution_buffer": "Tris-HCl", | ||
"family_name": null, | ||
"father": null, | ||
"formalin_fixation_time": "15", | ||
"mother": null, | ||
"name": "BalsamicSample", | ||
"phenotype_groups": [ | ||
"PhGroup" | ||
], | ||
"phenotype_terms": [ | ||
"PhTerm" | ||
], | ||
"post_formalin_fixation_time": "3", | ||
"priority": null, | ||
"quantity": null, | ||
"reference_genome": null, | ||
"require_qc_ok": false, | ||
"sex": "male", | ||
"source": "cytology (FFPE)", | ||
"source_comment": null, | ||
"status": null, | ||
"subject_id": "Subject1", | ||
"tissue_block_size": "large", | ||
"tumour": true, | ||
"tumour_purity": "13", | ||
"volume": 42, | ||
"well_position": "A:1" | ||
} | ||
], | ||
"synopsis": "A synopsis" | ||
} | ||
], | ||
"comment": null, | ||
"customer": "cust000", | ||
"data_analysis": "balsamic", | ||
"data_delivery": null, | ||
"delivery_type": "analysis-scout", | ||
"name": "BalsamicOrder", | ||
"project_type": "balsamic", | ||
"ticket": null, | ||
"user_id": 1 | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/services/orders/validation_service/test_validation_service.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
|
||
from cg.exc import OrderError | ||
from cg.models.orders.constants import OrderType | ||
from cg.services.orders.validation.service import OrderValidationService | ||
|
||
|
||
def test_parse_and_validate_pydantic_error( | ||
order_validation_service: OrderValidationService, invalid_balsamic_order_to_submit: dict | ||
): | ||
# GIVEN a raw order that will fail validation and a validation service | ||
|
||
# WHEN parsing and validating the order | ||
|
||
# THEN an OrderError should be raised | ||
with pytest.raises(OrderError): | ||
order_validation_service.parse_and_validate( | ||
raw_order=invalid_balsamic_order_to_submit, | ||
order_type=OrderType.BALSAMIC, | ||
user_id=1, | ||
) |