-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
910fd92
commit b2a5147
Showing
45 changed files
with
105 additions
and
116 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
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
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
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ async def repository(moto_dynamodb_client: DynamoDBClient) -> AsyncGenerator[Dyn | |
await moto_dynamodb_client.delete_table(TableName=table_name) | ||
|
||
|
||
@pytest.mark.asyncio() | ||
@pytest.mark.asyncio | ||
async def test_save_customer(repository: DynamoDBCustomerRepository) -> None: | ||
# Arrange | ||
customer = Customer.create(name="John Doe", email="[email protected]") | ||
|
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ async def repository(moto_dynamodb_client: DynamoDBClient) -> AsyncGenerator[Dyn | |
|
||
|
||
# --8<-- [start:tests] | ||
@pytest.mark.asyncio() | ||
@pytest.mark.asyncio | ||
async def test_save_customer(repository: DynamoDBCustomerRepository, moto_dynamodb_client: DynamoDBClient) -> None: | ||
# Arrange | ||
customer = Customer.create(name="John Doe", email="[email protected]") | ||
|
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ async def repository(moto_dynamodb_client: DynamoDBClient) -> AsyncGenerator[Dyn | |
|
||
|
||
# --8<-- [start:tests] | ||
@pytest.mark.asyncio() | ||
@pytest.mark.asyncio | ||
async def test_save_customer(repository: DynamoDBCustomerRepository) -> None: | ||
# Arrange | ||
customer = Customer.create(name="John Doe", email="[email protected]") | ||
|
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 |
---|---|---|
|
@@ -25,7 +25,7 @@ async def dynamodb_repository(moto_dynamodb_client: DynamoDBClient) -> AsyncGene | |
await moto_dynamodb_client.delete_table(TableName=table_name) | ||
|
||
|
||
@pytest.fixture() | ||
@pytest.fixture | ||
def fake_repository() -> InMemoryRepository: | ||
return InMemoryRepository([]) | ||
|
||
|
@@ -48,7 +48,7 @@ def repository( | |
|
||
|
||
# --8<-- [start:tests] | ||
@pytest.mark.asyncio() | ||
@pytest.mark.asyncio | ||
async def test_save_customer(repository: CustomerRepository) -> None: | ||
customer = Customer.create(name="John Doe", email="[email protected]") | ||
|
||
|
@@ -57,13 +57,13 @@ async def test_save_customer(repository: CustomerRepository) -> None: | |
assert await repository.get(customer.id) == customer | ||
|
||
|
||
@pytest.mark.asyncio() | ||
@pytest.mark.asyncio | ||
async def test_customer_not_found(repository: CustomerRepository) -> None: | ||
with pytest.raises(CustomerNotFoundError, match="123456"): | ||
await repository.get("123456") | ||
|
||
|
||
@pytest.mark.asyncio() | ||
@pytest.mark.asyncio | ||
async def test_customer_id_should_be_unique(repository: CustomerRepository) -> None: | ||
customer_id = str(uuid.uuid4()) | ||
customer_1 = Customer(id=customer_id, name="John Doe", email="[email protected]") | ||
|
@@ -74,7 +74,7 @@ async def test_customer_id_should_be_unique(repository: CustomerRepository) -> N | |
await repository.save(customer_2) | ||
|
||
|
||
@pytest.mark.asyncio() | ||
@pytest.mark.asyncio | ||
async def test_customer_email_should_be_unique(repository: CustomerRepository) -> None: | ||
customer_1 = Customer.create(name="John Doe", email="[email protected]") | ||
customer_2 = Customer.create(name="John Doe", email="[email protected]") | ||
|
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
Oops, something went wrong.