#NEWLINE# def test_log_line_parser_query_args( self ) : #NEWLINE# #INDENT# p = access_processor . AccessLogProcessor ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# log_line = [ str ( x ) for x in range ( 18 ) ] #NEWLINE# log_line [ 1 ] = 'proxy-server' #NEWLINE# log_line [ 4 ] = '1/Jan/3/4/5/6' #NEWLINE# query = 'foo' #NEWLINE# for param in access_processor . LISTING_PARAMS : #NEWLINE# #INDENT# query += ( '&%s=blah' % param ) #NEWLINE# #UNINDENT# log_line [ 6 ] = ( '/v1/a/c/o?%s' % query ) #NEWLINE# log_line = ( ( 'x' * 16 ) + ' ' . join ( log_line ) ) #NEWLINE# res = p . log_line_parser ( log_line ) #NEWLINE# expected = { #NEWLINE# #INDENT# 'code' : 8 , #NEWLINE# 'processing_time' : '17' , #NEWLINE# 'auth_token' : '11' , #NEWLINE# 'month' : '01' , #NEWLINE# 'second' : '6' , #NEWLINE# 'year' : '3' , #NEWLINE# 'tz' : '+0000' , #NEWLINE# 'http_version' : '7' , #NEWLINE# 'object_name' : 'o' , #NEWLINE# 'etag' : '14' , #NEWLINE# 'method' : '5' , #NEWLINE# 'trans_id' : '15' , #NEWLINE# 'client_ip' : '2' , #NEWLINE# 'bytes_out' : 13 , #NEWLINE# 'container_name' : 'c' , #NEWLINE# 'day' : '1' , #NEWLINE# 'minute' : '5' , #NEWLINE# 'account' : 'a' , #NEWLINE# 'hour' : '4' , #NEWLINE# 'referrer' : '9' , #NEWLINE# 'request' : '/v1/a/c/o' , #NEWLINE# 'user_agent' : '10' , #NEWLINE# 'bytes_in' : 12 , #NEWLINE# 'lb_ip' : '3' , #NEWLINE# 'log_source' : None , #NEWLINE# #UNINDENT# } #NEWLINE# for param in access_processor . LISTING_PARAMS : #NEWLINE# #INDENT# expected [ param ] = 1 #NEWLINE# #UNINDENT# expected [ 'query' ] = query #NEWLINE# self . assertEquals ( p , expected )