File tree 1 file changed +51
-0
lines changed
1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -1332,6 +1332,57 @@ def test_query(self):
1332
1332
}
1333
1333
self .assertEqual (req .call_args [0 ][1 ], params )
1334
1334
1335
+ with patch (PATCH_METHOD ) as req :
1336
+ req .return_value = {}
1337
+ conn .query (
1338
+ table_name ,
1339
+ "FooForum" ,
1340
+ Path ('Subject' ).startswith ('thread' ),
1341
+ Path ('a2' ).exists ()
1342
+ | Path ('a3' ).exists ()
1343
+ | Path ('a4' ).exists ()
1344
+ | Path ('a5' ).exists ()
1345
+ | Path ('a6' ).exists ()
1346
+ | Path ('a7' ).exists ()
1347
+ | Path ('a8' ).exists ()
1348
+ | Path ('a9' ).exists ()
1349
+ | Path ('a10' ).exists ()
1350
+ )
1351
+
1352
+ params = {
1353
+ 'TableName' : 'Thread' ,
1354
+ 'KeyConditionExpression' : '(#0 = :0 AND begins_with (#1, :1))' ,
1355
+ 'FilterExpression' :
1356
+ '((((((((attribute_exists (#2) '
1357
+ 'OR attribute_exists (#3)) '
1358
+ 'OR attribute_exists (#4)) '
1359
+ 'OR attribute_exists (#5)) '
1360
+ 'OR attribute_exists (#6)) '
1361
+ 'OR attribute_exists (#7)) '
1362
+ 'OR attribute_exists (#8)) '
1363
+ 'OR attribute_exists (#9)) '
1364
+ 'OR attribute_exists (#10))' ,
1365
+ 'ExpressionAttributeNames' : {
1366
+ '#0' : 'ForumName' ,
1367
+ '#1' : 'Subject' ,
1368
+ '#2' : 'a2' ,
1369
+ '#3' : 'a3' ,
1370
+ '#4' : 'a4' ,
1371
+ '#5' : 'a5' ,
1372
+ '#6' : 'a6' ,
1373
+ '#7' : 'a7' ,
1374
+ '#8' : 'a8' ,
1375
+ '#9' : 'a9' ,
1376
+ '#10' : 'a10'
1377
+ },
1378
+ 'ExpressionAttributeValues' : {
1379
+ ':0' : {'S' : 'FooForum' },
1380
+ ':1' : {'S' : 'thread' }
1381
+ },
1382
+ 'ReturnConsumedCapacity' : 'TOTAL'
1383
+ }
1384
+ self .assertEqual (req .call_args [0 ][1 ], params )
1385
+
1335
1386
def test_scan (self ):
1336
1387
"""
1337
1388
Connection.scan
You can’t perform that action at this time.
0 commit comments