@@ -1485,7 +1485,7 @@ def verify_scan_call_args(call_args,
1485
1485
self .assertEqual (call_args [1 ]['segment' ], segment )
1486
1486
1487
1487
with patch (SCAN_METHOD_TO_PATCH ) as req :
1488
- req .return_value = {'Items' : [], 'ConsumedCapacity' : 10 }
1488
+ req .return_value = {'Items' : [], 'ConsumedCapacity' : { 'TableName' : table_name , 'CapacityUnits' : 10.0 } }
1489
1489
resp = conn .rate_limited_scan (
1490
1490
table_name
1491
1491
)
@@ -1494,7 +1494,7 @@ def verify_scan_call_args(call_args,
1494
1494
verify_scan_call_args (req .call_args , table_name )
1495
1495
1496
1496
with patch (SCAN_METHOD_TO_PATCH ) as req :
1497
- req .return_value = {'Items' : [], 'ConsumedCapacity' : 10 }
1497
+ req .return_value = {'Items' : [], 'ConsumedCapacity' : { 'TableName' : table_name , 'CapacityUnits' : 10.0 } }
1498
1498
resp = conn .rate_limited_scan (
1499
1499
table_name ,
1500
1500
limit = 10 ,
@@ -1511,7 +1511,7 @@ def verify_scan_call_args(call_args,
1511
1511
limit = 10 )
1512
1512
1513
1513
with patch (SCAN_METHOD_TO_PATCH ) as req :
1514
- req .return_value = {'Items' : [], 'ConsumedCapacity' : 10 }
1514
+ req .return_value = {'Items' : [], 'ConsumedCapacity' : { 'TableName' : table_name , 'CapacityUnits' : 10.0 } }
1515
1515
scan_filter = {
1516
1516
'ForumName' : {
1517
1517
'AttributeValueList' : [
@@ -1551,7 +1551,7 @@ def verify_scan_call_args(call_args,
1551
1551
conditional_operator = 'AND' )
1552
1552
1553
1553
with patch (SCAN_METHOD_TO_PATCH ) as req :
1554
- req .return_value = {'Items' : [], 'ConsumedCapacity' : 10 }
1554
+ req .return_value = {'Items' : [], 'ConsumedCapacity' : { 'TableName' : table_name , 'CapacityUnits' : 10.0 } }
1555
1555
resp = conn .rate_limited_scan (
1556
1556
table_name ,
1557
1557
page_size = 5 ,
@@ -1565,7 +1565,7 @@ def verify_scan_call_args(call_args,
1565
1565
limit = 5 )
1566
1566
1567
1567
with patch (SCAN_METHOD_TO_PATCH ) as req :
1568
- req .return_value = {'Items' : [], 'ConsumedCapacity' : 10 }
1568
+ req .return_value = {'Items' : [], 'ConsumedCapacity' : { 'TableName' : table_name , 'CapacityUnits' : 10.0 } }
1569
1569
resp = conn .rate_limited_scan (
1570
1570
table_name ,
1571
1571
limit = 10 ,
@@ -1767,8 +1767,8 @@ def test_ratelimited_scan_with_pagination_ends(self, scan_mock, time_mock):
1767
1767
c = Connection ()
1768
1768
time_mock .side_effect = [1 , 10 , 20 , 30 , 40 ]
1769
1769
scan_mock .side_effect = [
1770
- {'Items' : ['Item-1' ], 'ConsumedCapacity' : 1 , 'LastEvaluatedKey' : 'XX' },
1771
- {'Items' : ['Item-2' ], 'ConsumedCapacity' : 1 }
1770
+ {'Items' : ['Item-1' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 1 } , 'LastEvaluatedKey' : 'XX' },
1771
+ {'Items' : ['Item-2' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 1 } }
1772
1772
]
1773
1773
resp = c .rate_limited_scan ('Table_1' )
1774
1774
values = list (resp )
@@ -1787,7 +1787,7 @@ def test_ratelimited_scan_retries_on_throttling(self, api_mock, sleep_mock, time
1787
1787
1788
1788
api_mock .side_effect = [
1789
1789
VerboseClientError (botocore_expected_format , 'operation_name' , {}),
1790
- {'Items' : ['Item-1' , 'Item-2' ], 'ConsumedCapacity' : 40 }
1790
+ {'Items' : ['Item-1' , 'Item-2' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 40 } }
1791
1791
]
1792
1792
resp = c .rate_limited_scan ('Table_1' )
1793
1793
values = list (resp )
@@ -1853,8 +1853,8 @@ def test_rate_limited_scan_retries_on_rate_unavailable(self, scan_mock, sleep_mo
1853
1853
sleep_mock .return_value = 1
1854
1854
time_mock .side_effect = [1 , 4 , 6 , 12 ]
1855
1855
scan_mock .side_effect = [
1856
- {'Items' : ['Item-1' ], 'ConsumedCapacity' : 80 , 'LastEvaluatedKey' : 'XX' },
1857
- {'Items' : ['Item-2' ], 'ConsumedCapacity' : 41 }
1856
+ {'Items' : ['Item-1' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 80 } , 'LastEvaluatedKey' : 'XX' },
1857
+ {'Items' : ['Item-2' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 41 } }
1858
1858
]
1859
1859
resp = c .rate_limited_scan ('Table_1' )
1860
1860
values = list (resp )
@@ -1873,8 +1873,8 @@ def test_rate_limited_scan_retries_on_rate_unavailable_within_s(self, scan_mock,
1873
1873
sleep_mock .return_value = 1
1874
1874
time_mock .side_effect = [1.0 , 1.5 , 4.0 ]
1875
1875
scan_mock .side_effect = [
1876
- {'Items' : ['Item-1' ], 'ConsumedCapacity' : 10 , 'LastEvaluatedKey' : 'XX' },
1877
- {'Items' : ['Item-2' ], 'ConsumedCapacity' : 11 }
1876
+ {'Items' : ['Item-1' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 10 } , 'LastEvaluatedKey' : 'XX' },
1877
+ {'Items' : ['Item-2' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 11 } }
1878
1878
]
1879
1879
resp = c .rate_limited_scan ('Table_1' , read_capacity_to_consume_per_second = 5 )
1880
1880
values = list (resp )
@@ -1892,8 +1892,8 @@ def test_rate_limited_scan_retries_max_sleep(self, scan_mock, sleep_mock, time_m
1892
1892
sleep_mock .return_value = 1
1893
1893
time_mock .side_effect = [1.0 , 1.5 , 250 , 350 ]
1894
1894
scan_mock .side_effect = [
1895
- {'Items' : ['Item-1' ], 'ConsumedCapacity' : 1000 , 'LastEvaluatedKey' : 'XX' },
1896
- {'Items' : ['Item-2' ], 'ConsumedCapacity' : 11 }
1895
+ {'Items' : ['Item-1' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 1000 } , 'LastEvaluatedKey' : 'XX' },
1896
+ {'Items' : ['Item-2' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 11 } }
1897
1897
]
1898
1898
resp = c .rate_limited_scan (
1899
1899
'Table_1' ,
@@ -1915,8 +1915,8 @@ def test_rate_limited_scan_retries_min_sleep(self, scan_mock, sleep_mock, time_m
1915
1915
sleep_mock .return_value = 1
1916
1916
time_mock .side_effect = [1 , 2 , 3 , 4 ]
1917
1917
scan_mock .side_effect = [
1918
- {'Items' : ['Item-1' ], 'ConsumedCapacity' : 10 , 'LastEvaluatedKey' : 'XX' },
1919
- {'Items' : ['Item-2' ], 'ConsumedCapacity' : 11 }
1918
+ {'Items' : ['Item-1' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 10 } , 'LastEvaluatedKey' : 'XX' },
1919
+ {'Items' : ['Item-2' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 11 } }
1920
1920
]
1921
1921
resp = c .rate_limited_scan ('Table_1' , read_capacity_to_consume_per_second = 8 )
1922
1922
values = list (resp )
@@ -1934,8 +1934,8 @@ def test_rate_limited_scan_retries_timeout(self, scan_mock, sleep_mock, time_moc
1934
1934
sleep_mock .return_value = 1
1935
1935
time_mock .side_effect = [1 , 20 , 30 , 40 ]
1936
1936
scan_mock .side_effect = [
1937
- {'Items' : ['Item-1' ], 'ConsumedCapacity' : 1000 , 'LastEvaluatedKey' : 'XX' },
1938
- {'Items' : ['Item-2' ], 'ConsumedCapacity' : 11 }
1937
+ {'Items' : ['Item-1' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 1000 } , 'LastEvaluatedKey' : 'XX' },
1938
+ {'Items' : ['Item-2' ], 'ConsumedCapacity' : { 'TableName' : 'Table_1' , 'CapacityUnits' : 11 } }
1939
1939
]
1940
1940
resp = c .rate_limited_scan (
1941
1941
'Table_1' ,
0 commit comments