-
Notifications
You must be signed in to change notification settings - Fork 120
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
20 changed files
with
153 additions
and
112 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
from seedwork.infrastructure.logging import logger | ||
|
||
|
||
def setup_app_for_bidding_tests(app, listing_id, seller_id, bidder_id): | ||
async def setup_app_for_bidding_tests(app, listing_id, seller_id, bidder_id): | ||
logger.info("Adding users") | ||
with app.transaction_context() as ctx: | ||
iam_service = ctx["iam_service"] | ||
|
@@ -19,15 +19,17 @@ def setup_app_for_bidding_tests(app, listing_id, seller_id, bidder_id): | |
password="password", | ||
access_token="token1", | ||
) | ||
ctx["logger"].debug(f"Added seller: {seller_id}") | ||
|
||
iam_service.create_user( | ||
user_id=bidder_id, | ||
email="[email protected]", | ||
password="password", | ||
access_token="token2", | ||
) | ||
ctx["logger"].debug(f"Added bidder: {bidder_id}") | ||
|
||
logger.info("Adding listing") | ||
app.execute( | ||
await app.execute_async( | ||
CreateListingDraftCommand( | ||
listing_id=listing_id, | ||
title="Foo", | ||
|
@@ -36,18 +38,23 @@ def setup_app_for_bidding_tests(app, listing_id, seller_id, bidder_id): | |
seller_id=seller_id, | ||
) | ||
) | ||
app.execute( | ||
logger.info(f"Created listing draft: {listing_id}") | ||
|
||
await app.execute_async( | ||
PublishListingDraftCommand(listing_id=listing_id, seller_id=seller_id) | ||
) | ||
logger.info(f"Published listing draft {listing_id} by seller {seller_id}") | ||
|
||
logger.info("test setup complete") | ||
|
||
|
||
@pytest.mark.integration | ||
def test_place_bid(app, api_client): | ||
@pytest.mark.asyncio | ||
async def test_place_bid(app, api_client): | ||
listing_id = GenericUUID(int=1) | ||
seller_id = GenericUUID(int=2) | ||
bidder_id = GenericUUID(int=3) | ||
setup_app_for_bidding_tests(app, listing_id, seller_id, bidder_id) | ||
await setup_app_for_bidding_tests(app, listing_id, seller_id, bidder_id) | ||
|
||
url = f"/bidding/{listing_id}/place_bid" | ||
|
||
|
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
Oops, something went wrong.