@@ -225,7 +225,7 @@ def test_idempotent_lambda_first_execution_cached(
225
225
Test idempotent decorator when lambda is executed with an event with a previously unknown event key. Ensure
226
226
result is cached locally on the persistence store instance.
227
227
"""
228
- persistence_store .configure (idempotency_config )
228
+ persistence_store ._configure (idempotency_config )
229
229
save_to_cache_spy = mocker .spy (persistence_store , "_save_to_cache" )
230
230
retrieve_from_cache_spy = mocker .spy (persistence_store , "_retrieve_from_cache" )
231
231
stubber = stub .Stubber (persistence_store .table .meta .client )
@@ -625,7 +625,7 @@ def test_data_record_invalid_status_value():
625
625
def test_in_progress_never_saved_to_cache (idempotency_config , persistence_store ):
626
626
# GIVEN a data record with status "INPROGRESS"
627
627
# and persistence_store has use_local_cache = True
628
- persistence_store .configure (idempotency_config )
628
+ persistence_store ._configure (idempotency_config )
629
629
data_record = DataRecord ("key" , status = "INPROGRESS" )
630
630
631
631
# WHEN saving to local cache
@@ -638,7 +638,7 @@ def test_in_progress_never_saved_to_cache(idempotency_config, persistence_store)
638
638
@pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : False }], indirect = True )
639
639
def test_user_local_disabled (idempotency_config , persistence_store ):
640
640
# GIVEN a persistence_store with use_local_cache = False
641
- persistence_store .configure (idempotency_config )
641
+ persistence_store ._configure (idempotency_config )
642
642
643
643
# WHEN calling any local cache options
644
644
data_record = DataRecord ("key" , status = "COMPLETED" )
@@ -658,7 +658,7 @@ def test_user_local_disabled(idempotency_config, persistence_store):
658
658
@pytest .mark .parametrize ("idempotency_config" , [{"use_local_cache" : True }], indirect = True )
659
659
def test_delete_from_cache_when_empty (idempotency_config , persistence_store ):
660
660
# GIVEN use_local_cache is True AND the local cache is empty
661
- persistence_store .configure (idempotency_config )
661
+ persistence_store ._configure (idempotency_config )
662
662
663
663
try :
664
664
# WHEN we _delete_from_cache
@@ -692,7 +692,7 @@ def test_is_missing_idempotency_key():
692
692
)
693
693
def test_default_no_raise_on_missing_idempotency_key (idempotency_config , persistence_store ):
694
694
# GIVEN a persistence_store with use_local_cache = False and event_key_jmespath = "body"
695
- persistence_store .configure (idempotency_config )
695
+ persistence_store ._configure (idempotency_config )
696
696
assert persistence_store .use_local_cache is False
697
697
assert "body" in persistence_store .event_key_jmespath
698
698
@@ -708,7 +708,7 @@ def test_default_no_raise_on_missing_idempotency_key(idempotency_config, persist
708
708
)
709
709
def test_raise_on_no_idempotency_key (idempotency_config , persistence_store ):
710
710
# GIVEN a persistence_store with raise_on_no_idempotency_key and no idempotency key in the request
711
- persistence_store .configure (idempotency_config )
711
+ persistence_store ._configure (idempotency_config )
712
712
persistence_store .raise_on_no_idempotency_key = True
713
713
assert persistence_store .use_local_cache is False
714
714
assert "body" in persistence_store .event_key_jmespath
@@ -724,7 +724,7 @@ def test_raise_on_no_idempotency_key(idempotency_config, persistence_store):
724
724
def test_jmespath_with_powertools_json (persistence_store ):
725
725
# GIVEN an event_key_jmespath with powertools_json custom function
726
726
config = IdempotencyConfig (event_key_jmespath = "[requestContext.authorizer.claims.sub, powertools_json(body).id]" )
727
- persistence_store .configure (config )
727
+ persistence_store ._configure (config )
728
728
sub_attr_value = "cognito_user"
729
729
key_attr_value = "some_key"
730
730
expected_value = [sub_attr_value , key_attr_value ]
@@ -744,7 +744,7 @@ def test_jmespath_with_powertools_json(persistence_store):
744
744
def test_custom_jmespath_function_overrides_builtin_functions (config_with_jmespath_options , persistence_store ):
745
745
# GIVEN an persistence store with a custom jmespath_options
746
746
# AND use a builtin powertools custom function
747
- persistence_store .configure (config_with_jmespath_options )
747
+ persistence_store ._configure (config_with_jmespath_options )
748
748
with pytest .raises (jmespath .exceptions .UnknownFunctionError , match = "Unknown function: powertools_json()" ):
749
749
# WHEN calling _get_hashed_idempotency_key
750
750
# THEN raise unknown function
0 commit comments