5858 basic_batch_get_item_response ,
5959 basic_batch_write_item_put_response ,
6060 basic_delete_item_response ,
61+ exhaustive_delete_item_response ,
6162 basic_get_item_response ,
6263 basic_put_item_response ,
6364 basic_query_response ,
6465 basic_scan_response ,
6566 basic_transact_get_items_response ,
6667 basic_transact_write_items_response ,
6768 basic_update_item_response ,
69+ exhaustive_update_item_response ,
6870 exhaustive_batch_get_item_response ,
6971 exhaustive_batch_write_item_put_response ,
7072 exhaustive_get_item_response ,
7173 exhaustive_put_item_response ,
7274 exhaustive_query_response ,
7375 exhaustive_scan_response ,
76+ exhaustive_execute_statement_response ,
77+ basic_execute_statement_response ,
78+ basic_execute_transaction_response ,
79+ basic_batch_execute_statement_response ,
80+ exhaustive_batch_execute_statement_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,20 @@ 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 (test_execute_statement_response , test_ddb_item , test_dict_item ):
620633 # Given: Execute statement response
621- # TODO: this
622- ddb_response = {}
634+ ddb_response = test_execute_statement_response ([test_ddb_item ])
623635 # When: Converting to resource format
624636 resource_response = client_to_resource_converter .execute_statement_response (ddb_response )
625637 # Then: Returns dict value
626- assert resource_response == {}
638+ assert resource_response == test_execute_statement_response ([ test_dict_item ])
627639
628640
629641@pytest .fixture
@@ -641,19 +653,22 @@ def test_GIVEN_test_execute_transaction_request_WHEN_client_to_resource_THEN_ret
641653 # Then: Returns dict value (here, request is not modified)
642654 assert dict_item == test_execute_transaction_request (test_dict_item )
643655
656+ @pytest .fixture
657+ def test_execute_transaction_response ():
658+ return basic_execute_transaction_response
659+
644660
645- def test_GIVEN_test_execute_transaction_response_WHEN_client_to_resource_THEN_returns_dict_value ():
661+ def test_GIVEN_test_execute_transaction_response_WHEN_client_to_resource_THEN_returns_dict_value (test_execute_transaction_response , test_ddb_item , test_dict_item ):
646662 # Given: Execute transaction response
647- # TODO: this
648- ddb_response = {}
663+ ddb_response = test_execute_transaction_response ([test_ddb_item ])
649664 # When: Converting to resource format
650665 resource_response = client_to_resource_converter .execute_transaction_response (ddb_response )
651666 # Then: Returns dict value
652- assert resource_response == {}
667+ assert resource_response == test_execute_transaction_response ([ test_dict_item ])
653668
654669
655670@pytest .fixture
656- def test_batch_execute_statement_request ():
671+ def test_batch_execute_statement_request (use_exhaustive_request ):
657672 return basic_batch_execute_statement_request_encrypted_table
658673
659674
@@ -668,14 +683,20 @@ def test_GIVEN_test_batch_execute_statement_request_WHEN_client_to_resource_THEN
668683 assert dict_item == test_batch_execute_statement_request ()
669684
670685
671- def test_GIVEN_test_batch_execute_statement_response_WHEN_client_to_resource_THEN_raises_NotImplementedError ():
686+ @pytest .fixture
687+ def test_batch_execute_statement_response (use_exhaustive_request ):
688+ if use_exhaustive_request :
689+ return exhaustive_batch_execute_statement_response
690+ return basic_batch_execute_statement_response
691+
692+
693+ def test_GIVEN_test_batch_execute_statement_response_WHEN_client_to_resource_THEN_returns_dict_value (test_batch_execute_statement_response , test_ddb_item , test_dict_item ):
672694 # Given: Batch execute statement response
673- # TODO: this
674- ddb_response = {}
695+ ddb_response = test_batch_execute_statement_response ([test_ddb_item ])
675696 # When: Converting to resource format
676697 resource_response = client_to_resource_converter .batch_execute_statement_response (ddb_response )
677698 # Then: Returns dict value
678- assert resource_response == {}
699+ assert resource_response == test_batch_execute_statement_response ([ test_dict_item ])
679700
680701
681702@pytest .fixture
@@ -700,7 +721,9 @@ def test_GIVEN_test_delete_item_request_WHEN_client_to_resource_THEN_returns_dic
700721
701722
702723@pytest .fixture
703- def test_delete_item_response ():
724+ def test_delete_item_response (use_exhaustive_request ):
725+ if use_exhaustive_request :
726+ return exhaustive_delete_item_response
704727 return basic_delete_item_response
705728
706729
0 commit comments