Skip to content

Commit

Permalink
new test for parsing skip reception control
Browse files Browse the repository at this point in the history
  • Loading branch information
diitaz93 committed Jan 23, 2025
1 parent 25c5aee commit 1987cd9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/services/orders/lims_service/test_order_lims_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,23 @@ def test_to_lims_balsamic(balsamic_order: BalsamicOrder):
assert first_sample["udfs"]["post_formalin_fixation_time"] == "3"
assert first_sample["udfs"]["tissue_block_size"] == "large"
assert first_sample["udfs"]["comment"] == "This is a sample comment"


def test_order_with_skip_reception_control(balsamic_order: BalsamicOrder):
"""Test that an order set to skip reception control can be parsed correctly by LIMS."""
# GIVEN a Balsamic order with one case and one sample set to skip reception control
balsamic_order.skip_reception_control = True

# WHEN parsing the order to format for LIMS import
new_samples = [sample for _, _, sample in balsamic_order.enumerated_new_samples]
samples: list[LimsSample] = OrderLimsService._build_lims_sample(
customer="cust000",
samples=new_samples,
workflow=Workflow.BALSAMIC,
delivery_type=balsamic_order.delivery_type,
skip_reception_control=balsamic_order.skip_reception_control,
)

# THEN the parsed samples should have the skip reception control flag set
first_sample = samples[0].dict()
assert first_sample["udfs"]["skip_reception_control"] is True

0 comments on commit 1987cd9

Please sign in to comment.