Skip to content

Commit

Permalink
refactored to use old fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
diitaz93 committed Jan 21, 2025
1 parent efe8a6a commit df444dc
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 170 deletions.
18 changes: 0 additions & 18 deletions tests/fixture_plugins/orders_fixtures/order_to_submit_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,3 @@ def invalid_balsamic_order_to_submit(invalid_cgweb_orders_dir: Path) -> dict:
return ReadFile.get_content_from_file(
file_format=FileFormat.JSON, file_path=Path(invalid_cgweb_orders_dir, "balsamic_FAIL.json")
)


@pytest.fixture(scope="session")
def fluffy_order_to_submit_without_index_sequence(invalid_cgweb_orders_dir) -> dict:
"""Load an invalid example Fluffy order."""
return ReadFile.get_content_from_file(
file_format=FileFormat.JSON,
file_path=Path(invalid_cgweb_orders_dir, "fluffy_no_index_sequence.json"),
)


@pytest.fixture(scope="session")
def rml_order_to_submit_without_index_sequence(invalid_cgweb_orders_dir) -> dict:
"""Load an invalid example RML order."""
return ReadFile.get_content_from_file(
file_format=FileFormat.JSON,
file_path=Path(invalid_cgweb_orders_dir, "rml_no_index_sequence.json"),
)
2 changes: 1 addition & 1 deletion tests/fixtures/cgweb_orders/fluffy.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"formalin_fixation_time": null,
"index": "IDT DupSeq 10 bp Set B",
"index_number": "3",
"index_sequence": "C01 IDT_10nt_568 (TGTGAGCGAA-AACTCCGATC)",
"index_sequence": "",
"internal_id": null,
"lab_code": null,
"mother": null,
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/cgweb_orders/rml.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"formalin_fixation_time": null,
"index": "IDT DupSeq 10 bp Set B",
"index_number": "3",
"index_sequence": "C01 IDT_10nt_568 (TGTGAGCGAA-AACTCCGATC)",
"index_sequence": "",
"internal_id": null,
"lab_code": null,
"mother": null,
Expand Down
72 changes: 0 additions & 72 deletions tests/fixtures/invalid_cgweb_orders/fluffy_no_index_sequence.json

This file was deleted.

72 changes: 0 additions & 72 deletions tests/fixtures/invalid_cgweb_orders/rml_no_index_sequence.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
@pytest.mark.parametrize(
"order_fixture, expected_index_sequence, order_model",
[
(
"fluffy_order_to_submit_without_index_sequence",
"C01 IDT_10nt_568 (TGTGAGCGAA-AACTCCGATC)",
FluffyOrder,
),
("rml_order_to_submit_without_index_sequence", "UDI 3 (CGCTGCTC-GGCAGATC)", RmlOrder),
("fluffy_order_to_submit", "C01 IDT_10nt_568 (TGTGAGCGAA-AACTCCGATC)", FluffyOrder),
("rml_order_to_submit", "C01 IDT_10nt_568 (TGTGAGCGAA-AACTCCGATC)", RmlOrder),
],
ids=["fluffy", "rml"],
)
Expand All @@ -27,6 +23,7 @@ def test_validate_pool_sample_default_index(
):
# GIVEN a pool raw order with a sample without index sequence but correct index and index number
raw_order: dict = request.getfixturevalue(order_fixture)
assert raw_order["samples"][0]["index_sequence"] == ""

# WHEN validating the order
order, _ = model_validator.validate(order=raw_order, model=order_model)
Expand Down

0 comments on commit df444dc

Please sign in to comment.