#NEWLINE# def testExtractUnencryptedQueries( self ) : #NEWLINE# #INDENT# stacks = [ [ util . FieldToken ( 'Year' ) ] , [ 1 ] , [ util . FieldToken ( 'Year' ) , 1 , util . OperatorToken ( '+' , 2 ) ] , [ util . ProbabilisticToken ( 'Price' ) ] , [ util . FieldToken ( ( 'GROUP_CONCAT(%sModel)' % util . PSEUDONYM_PREFIX ) ) ] , [ util . FieldToken ( 'SUM(Year + 1)' ) ] ] #NEWLINE# unencrypted_expression_list = [ ( ( 'Year AS ' + util . UNENCRYPTED_ALIAS_PREFIX ) + '0_' ) , ( ( '1 AS ' + util . UNENCRYPTED_ALIAS_PREFIX ) + '1_' ) , ( ( '(Year + 1) AS ' + util . UNENCRYPTED_ALIAS_PREFIX ) + '2_' ) , ( ( 'SUM(Year + 1) AS ' + util . UNENCRYPTED_ALIAS_PREFIX ) + '3_' ) ] #NEWLINE# self . assertEqual ( query_lib . _ExtractUnencryptedQueries ( stacks , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) , unencrypted_expression_list ) #NEWLINE# stacks = [ [ util . FieldToken ( 'Year' ) ] , [ 1 ] , [ util . FieldToken ( 'Year' ) , 1 , util . OperatorToken ( '+' , 2 ) ] , [ util . ProbabilisticToken ( 'Price' ) ] , [ util . FieldToken ( ( 'GROUP_CONCAT(%sModel)' % util . PSEUDONYM_PREFIX ) ) ] , [ util . FieldToken ( 'SUM(Year + 1)' ) ] ] #NEWLINE# within = { #NEWLINE# #INDENT# 4 : 'w1' , #NEWLINE# 5 : 'w2' , #NEWLINE# #UNINDENT# } #NEWLINE# unencrypted_expression_list = [ ( ( 'Year AS ' + util . UNENCRYPTED_ALIAS_PREFIX ) + '0_' ) , ( ( '1 AS ' + util . UNENCRYPTED_ALIAS_PREFIX ) + '1_' ) , ( ( '(Year + 1) AS ' + util . UNENCRYPTED_ALIAS_PREFIX ) + '2_' ) , ( ( 'SUM(Year + 1) WITHIN w2 AS ' + util . UNENCRYPTED_ALIAS_PREFIX ) + '3_' ) ] #NEWLINE# self . assertEqual ( query_lib . _ExtractUnencryptedQueries ( stacks , within ) , self )