58
58
basic_batch_get_item_response ,
59
59
basic_batch_write_item_put_response ,
60
60
basic_delete_item_response ,
61
+ exhaustive_delete_item_response ,
61
62
basic_get_item_response ,
62
63
basic_put_item_response ,
63
64
basic_query_response ,
64
65
basic_scan_response ,
65
66
basic_transact_get_items_response ,
66
67
basic_transact_write_items_response ,
67
68
basic_update_item_response ,
69
+ exhaustive_update_item_response ,
68
70
exhaustive_batch_get_item_response ,
69
71
exhaustive_batch_write_item_put_response ,
70
72
exhaustive_get_item_response ,
71
73
exhaustive_put_item_response ,
72
74
exhaustive_query_response ,
73
75
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 ,
74
81
)
75
82
76
83
client_to_resource_converter = ClientShapeToResourceShapeConverter ()
@@ -560,15 +567,13 @@ def test_GIVEN_test_transact_get_items_response_WHEN_client_to_resource_THEN_ret
560
567
def test_update_item_request_ddb ():
561
568
# Select unsigned attribute without loss of generality;
562
569
# resource/client logic doesn't care about signed attributes
563
- # TODO: Add exhaustive request
564
570
return basic_update_item_request_ddb_unsigned_attribute
565
571
566
572
567
573
@pytest .fixture
568
574
def test_update_item_request_dict ():
569
575
# Select unsigned attribute without loss of generality;
570
576
# resource/client logic doesn't care about signed attributes
571
- # TODO: Add exhaustive request
572
577
return basic_update_item_request_dict_unsigned_attribute
573
578
574
579
@@ -584,8 +589,9 @@ def test_GIVEN_test_update_item_request_WHEN_client_to_resource_THEN_returns_dic
584
589
585
590
586
591
@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
589
595
return basic_update_item_response
590
596
591
597
@@ -616,14 +622,20 @@ def test_GIVEN_test_execute_statement_request_WHEN_client_to_resource_THEN_retur
616
622
assert dict_item == test_execute_statement_request (test_dict_item )
617
623
618
624
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 ):
620
633
# Given: Execute statement response
621
- # TODO: this
622
- ddb_response = {}
634
+ ddb_response = test_execute_statement_response ([test_ddb_item ])
623
635
# When: Converting to resource format
624
636
resource_response = client_to_resource_converter .execute_statement_response (ddb_response )
625
637
# Then: Returns dict value
626
- assert resource_response == {}
638
+ assert resource_response == test_execute_statement_response ([ test_dict_item ])
627
639
628
640
629
641
@pytest .fixture
@@ -641,19 +653,22 @@ def test_GIVEN_test_execute_transaction_request_WHEN_client_to_resource_THEN_ret
641
653
# Then: Returns dict value (here, request is not modified)
642
654
assert dict_item == test_execute_transaction_request (test_dict_item )
643
655
656
+ @pytest .fixture
657
+ def test_execute_transaction_response ():
658
+ return basic_execute_transaction_response
659
+
644
660
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 ):
646
662
# Given: Execute transaction response
647
- # TODO: this
648
- ddb_response = {}
663
+ ddb_response = test_execute_transaction_response ([test_ddb_item ])
649
664
# When: Converting to resource format
650
665
resource_response = client_to_resource_converter .execute_transaction_response (ddb_response )
651
666
# Then: Returns dict value
652
- assert resource_response == {}
667
+ assert resource_response == test_execute_transaction_response ([ test_dict_item ])
653
668
654
669
655
670
@pytest .fixture
656
- def test_batch_execute_statement_request ():
671
+ def test_batch_execute_statement_request (use_exhaustive_request ):
657
672
return basic_batch_execute_statement_request_encrypted_table
658
673
659
674
@@ -668,14 +683,20 @@ def test_GIVEN_test_batch_execute_statement_request_WHEN_client_to_resource_THEN
668
683
assert dict_item == test_batch_execute_statement_request ()
669
684
670
685
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 ):
672
694
# Given: Batch execute statement response
673
- # TODO: this
674
- ddb_response = {}
695
+ ddb_response = test_batch_execute_statement_response ([test_ddb_item ])
675
696
# When: Converting to resource format
676
697
resource_response = client_to_resource_converter .batch_execute_statement_response (ddb_response )
677
698
# Then: Returns dict value
678
- assert resource_response == {}
699
+ assert resource_response == test_batch_execute_statement_response ([ test_dict_item ])
679
700
680
701
681
702
@pytest .fixture
@@ -700,7 +721,9 @@ def test_GIVEN_test_delete_item_request_WHEN_client_to_resource_THEN_returns_dic
700
721
701
722
702
723
@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
704
727
return basic_delete_item_response
705
728
706
729
0 commit comments