update exception

This commit is contained in:
2025-04-02 12:03:23 -03:00
parent ef4bfc07f3
commit 3a799fbbd1
4 changed files with 15 additions and 13 deletions

View File

@@ -10,7 +10,6 @@ from layercake.dynamodb import (
DynamoDBCollection,
DynamoDBPersistenceLayer,
KeyPair,
MissingError,
PartitionKey,
PrefixKey,
TransactItems,
@@ -121,8 +120,13 @@ def test_collection_get_item(
'update_date': '2023-11-09T12:13:04.308986-03:00',
}
with pytest.raises(MissingError):
collect.get_item(key=KeyPair('5OxmMjL-ujoR5IMGegQz', 'notfound'))
class NotFoundError(Exception): ...
with pytest.raises(NotFoundError):
collect.get_item(
KeyPair('5OxmMjL-ujoR5IMGegQz', 'notfound'),
exception_cls=NotFoundError,
)
def test_collection_put_item(