@@ -2371,6 +2371,33 @@ def test_batch_get(self):
2371
2371
}
2372
2372
self .assertEqual (params , req .call_args [0 ][1 ])
2373
2373
2374
+ with patch (PATCH_METHOD ) as req :
2375
+ req .return_value = SIMPLE_BATCH_GET_ITEMS
2376
+ item_keys = ['hash-{0}' .format (x ) for x in range (10 )]
2377
+ for item in SimpleUserModel .batch_get (item_keys , consistent_read = True ):
2378
+ self .assertIsNotNone (item )
2379
+ params = {
2380
+ 'ReturnConsumedCapacity' : 'TOTAL' ,
2381
+ 'RequestItems' : {
2382
+ 'SimpleModel' : {
2383
+ 'Keys' : [
2384
+ {'user_name' : {'S' : 'hash-9' }},
2385
+ {'user_name' : {'S' : 'hash-8' }},
2386
+ {'user_name' : {'S' : 'hash-7' }},
2387
+ {'user_name' : {'S' : 'hash-6' }},
2388
+ {'user_name' : {'S' : 'hash-5' }},
2389
+ {'user_name' : {'S' : 'hash-4' }},
2390
+ {'user_name' : {'S' : 'hash-3' }},
2391
+ {'user_name' : {'S' : 'hash-2' }},
2392
+ {'user_name' : {'S' : 'hash-1' }},
2393
+ {'user_name' : {'S' : 'hash-0' }}
2394
+ ],
2395
+ 'ConsistentRead' : True
2396
+ }
2397
+ }
2398
+ }
2399
+ self .assertEqual (params , req .call_args [0 ][1 ])
2400
+
2374
2401
with patch (PATCH_METHOD ) as req :
2375
2402
req .return_value = MODEL_TABLE_DATA
2376
2403
UserModel ('foo' , 'bar' )
0 commit comments