5555 exhaustive_scan_request_dict ,
5656)
5757from ...responses import (
58+ basic_batch_execute_statement_response ,
5859 basic_batch_get_item_response ,
5960 basic_batch_write_item_put_response ,
6061 basic_delete_item_response ,
62+ basic_execute_statement_response ,
63+ basic_execute_transaction_response ,
6164 basic_get_item_response ,
6265 basic_put_item_response ,
6366 basic_query_response ,
6467 basic_scan_response ,
6568 basic_transact_get_items_response ,
6669 basic_transact_write_items_response ,
6770 basic_update_item_response ,
71+ exhaustive_batch_execute_statement_response ,
6872 exhaustive_batch_get_item_response ,
6973 exhaustive_batch_write_item_put_response ,
74+ exhaustive_delete_item_response ,
75+ exhaustive_execute_statement_response ,
7076 exhaustive_get_item_response ,
7177 exhaustive_put_item_response ,
7278 exhaustive_query_response ,
7379 exhaustive_scan_response ,
80+ exhaustive_update_item_response ,
7481)
7582
7683client_to_resource_converter = ClientShapeToResourceShapeConverter ()
@@ -560,15 +567,13 @@ def test_GIVEN_test_transact_get_items_response_WHEN_client_to_resource_THEN_ret
560567def test_update_item_request_ddb ():
561568 # Select unsigned attribute without loss of generality;
562569 # resource/client logic doesn't care about signed attributes
563- # TODO: Add exhaustive request
564570 return basic_update_item_request_ddb_unsigned_attribute
565571
566572
567573@pytest .fixture
568574def test_update_item_request_dict ():
569575 # Select unsigned attribute without loss of generality;
570576 # resource/client logic doesn't care about signed attributes
571- # TODO: Add exhaustive request
572577 return basic_update_item_request_dict_unsigned_attribute
573578
574579
@@ -584,8 +589,9 @@ def test_GIVEN_test_update_item_request_WHEN_client_to_resource_THEN_returns_dic
584589
585590
586591@pytest .fixture
587- def test_update_item_response ():
588- # TODO: Add exhaustive response
592+ def test_update_item_response (use_exhaustive_request ):
593+ if use_exhaustive_request :
594+ return exhaustive_update_item_response
589595 return basic_update_item_response
590596
591597
@@ -616,14 +622,22 @@ def test_GIVEN_test_execute_statement_request_WHEN_client_to_resource_THEN_retur
616622 assert dict_item == test_execute_statement_request (test_dict_item )
617623
618624
619- def test_GIVEN_test_execute_statement_response_WHEN_client_to_resource_THEN_raises_NotImplementedError ():
625+ @pytest .fixture
626+ def test_execute_statement_response (use_exhaustive_request ):
627+ if use_exhaustive_request :
628+ return exhaustive_execute_statement_response
629+ return basic_execute_statement_response
630+
631+
632+ def test_GIVEN_test_execute_statement_response_WHEN_client_to_resource_THEN_returns_dict_value (
633+ test_execute_statement_response , test_ddb_item , test_dict_item
634+ ):
620635 # Given: Execute statement response
621- # TODO: this
622- ddb_response = {}
636+ ddb_response = test_execute_statement_response ([test_ddb_item ])
623637 # When: Converting to resource format
624638 resource_response = client_to_resource_converter .execute_statement_response (ddb_response )
625639 # Then: Returns dict value
626- assert resource_response == {}
640+ assert resource_response == test_execute_statement_response ([ test_dict_item ])
627641
628642
629643@pytest .fixture
@@ -642,18 +656,24 @@ def test_GIVEN_test_execute_transaction_request_WHEN_client_to_resource_THEN_ret
642656 assert dict_item == test_execute_transaction_request (test_dict_item )
643657
644658
645- def test_GIVEN_test_execute_transaction_response_WHEN_client_to_resource_THEN_returns_dict_value ():
659+ @pytest .fixture
660+ def test_execute_transaction_response ():
661+ return basic_execute_transaction_response
662+
663+
664+ def test_GIVEN_test_execute_transaction_response_WHEN_client_to_resource_THEN_returns_dict_value (
665+ test_execute_transaction_response , test_ddb_item , test_dict_item
666+ ):
646667 # Given: Execute transaction response
647- # TODO: this
648- ddb_response = {}
668+ ddb_response = test_execute_transaction_response ([test_ddb_item ])
649669 # When: Converting to resource format
650670 resource_response = client_to_resource_converter .execute_transaction_response (ddb_response )
651671 # Then: Returns dict value
652- assert resource_response == {}
672+ assert resource_response == test_execute_transaction_response ([ test_dict_item ])
653673
654674
655675@pytest .fixture
656- def test_batch_execute_statement_request ():
676+ def test_batch_execute_statement_request (use_exhaustive_request ):
657677 return basic_batch_execute_statement_request_encrypted_table
658678
659679
@@ -668,14 +688,22 @@ def test_GIVEN_test_batch_execute_statement_request_WHEN_client_to_resource_THEN
668688 assert dict_item == test_batch_execute_statement_request ()
669689
670690
671- def test_GIVEN_test_batch_execute_statement_response_WHEN_client_to_resource_THEN_raises_NotImplementedError ():
691+ @pytest .fixture
692+ def test_batch_execute_statement_response (use_exhaustive_request ):
693+ if use_exhaustive_request :
694+ return exhaustive_batch_execute_statement_response
695+ return basic_batch_execute_statement_response
696+
697+
698+ def test_GIVEN_test_batch_execute_statement_response_WHEN_client_to_resource_THEN_returns_dict_value (
699+ test_batch_execute_statement_response , test_ddb_item , test_dict_item
700+ ):
672701 # Given: Batch execute statement response
673- # TODO: this
674- ddb_response = {}
702+ ddb_response = test_batch_execute_statement_response ([test_ddb_item ])
675703 # When: Converting to resource format
676704 resource_response = client_to_resource_converter .batch_execute_statement_response (ddb_response )
677705 # Then: Returns dict value
678- assert resource_response == {}
706+ assert resource_response == test_batch_execute_statement_response ([ test_dict_item ])
679707
680708
681709@pytest .fixture
@@ -700,7 +728,9 @@ def test_GIVEN_test_delete_item_request_WHEN_client_to_resource_THEN_returns_dic
700728
701729
702730@pytest .fixture
703- def test_delete_item_response ():
731+ def test_delete_item_response (use_exhaustive_request ):
732+ if use_exhaustive_request :
733+ return exhaustive_delete_item_response
704734 return basic_delete_item_response
705735
706736
0 commit comments