add flatten top
This commit is contained in:
@@ -246,12 +246,11 @@ def test_collection_get_items(
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
):
|
||||
collect = DynamoDBCollection(dynamodb_persistence_layer)
|
||||
|
||||
doc = collect.get_items(
|
||||
TransactKey('cJtK9SsnJhKPyxESe7g3DG')
|
||||
+ SortKey('0')
|
||||
+ SortKey('billing_policy')
|
||||
+ SortKey('payment_policy')
|
||||
+ SortKey('payment_policy'),
|
||||
)
|
||||
|
||||
assert doc == {
|
||||
@@ -263,3 +262,22 @@ def test_collection_get_items(
|
||||
'billing_policy': {'billing_day': Decimal('1'), 'payment_method': 'PIX'},
|
||||
'payment_policy': {'due_days': Decimal('90')},
|
||||
}
|
||||
|
||||
|
||||
def test_collection_get_items_unflatten(
|
||||
dynamodb_seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
):
|
||||
collect = DynamoDBCollection(dynamodb_persistence_layer)
|
||||
|
||||
doc = collect.get_items(
|
||||
TransactKey('cJtK9SsnJhKPyxESe7g3DG')
|
||||
+ SortKey('billing_policy')
|
||||
+ SortKey('payment_policy'),
|
||||
flatten_top=False,
|
||||
)
|
||||
|
||||
assert doc == {
|
||||
'billing_policy': {'billing_day': Decimal('1'), 'payment_method': 'PIX'},
|
||||
'payment_policy': {'due_days': Decimal('90')},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user