-
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
8 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
Empty file.
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
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
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
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 @@ | ||
from cg.services.order_validation_service.models.errors import ApplicationNotValidError | ||
from cg.services.order_validation_service.models.order import Order | ||
from cg.services.order_validation_service.validators.data.rules import ( | ||
validate_application_exists, | ||
) | ||
from cg.store.store import Store | ||
|
||
|
||
def test_applications_exist(valid_order: Order, base_store: Store): | ||
# GIVEN an order where one of the samples has an invalid application | ||
for case in valid_order.cases: | ||
case.samples[0].application = "Invalid application" | ||
|
||
# WHEN validating the order | ||
errors = validate_application_exists(order=valid_order, store=base_store) | ||
|
||
# THEN an error should be returned | ||
assert errors | ||
|
||
# THEN the error should be about the ticket number | ||
assert isinstance(errors[0], ApplicationNotValidError) |