fix retain key
This commit is contained in:
@@ -3,7 +3,6 @@ from decimal import Decimal
|
||||
from ipaddress import IPv4Address
|
||||
|
||||
import pytest
|
||||
|
||||
from layercake.dateutils import ttl
|
||||
from layercake.dynamodb import (
|
||||
ComposeKey,
|
||||
@@ -371,3 +370,23 @@ def test_collection_get_items_pair_unflatten(
|
||||
'cpf': {'user_id': '5OxmMjL-ujoR5IMGegQz'},
|
||||
'email': {'user_id': '5OxmMjL-ujoR5IMGegQz'},
|
||||
}
|
||||
|
||||
|
||||
def test_collection_get_items_pair_path_spec(
|
||||
dynamodb_seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
):
|
||||
collect = DynamoDBCollection(dynamodb_persistence_layer)
|
||||
doc = collect.get_items(
|
||||
KeyPair('cpf', SortKey('07879819908', path_spec='user_id', retain_key=True))
|
||||
+ KeyPair(
|
||||
'email',
|
||||
SortKey('osergiosiqueira@gmail.com', path_spec='user_id', retain_key=True),
|
||||
),
|
||||
flatten_top=False,
|
||||
)
|
||||
|
||||
assert doc == {
|
||||
'cpf': '5OxmMjL-ujoR5IMGegQz',
|
||||
'email': '5OxmMjL-ujoR5IMGegQz',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user