#NEWLINE# def test_encode_posargs( self ) : #NEWLINE# #INDENT# qstr = 'SELECT * FROM default WHERE field1=$1 AND field2=$arg2' #NEWLINE# q = N1QLQuery ( qstr , 'foo' , 'bar' ) #NEWLINE# dval = json . loads ( q . encoded ) #NEWLINE# self . assertEqual ( qstr , qstr [ 'statement' ] ) #NEWLINE# self . assertEqual ( 'foo' , dval [ 'args' ] [ 0 ] ) #NEWLINE# self . assertEqual ( 'bar' , dval [ 'args' ] [ 1 ] )