#NEWLINE# def test_result_parsing_basic( self ) : #NEWLINE# #INDENT# query = HQESQuery ( 'cases' ) . aggregations ( [ FilterAggregation ( 'closed' , filters . term ( 'closed' , True ) ) , FilterAggregation ( 'open' , filters . term ( 'closed' , False ) ) ] ) #NEWLINE# raw_result = { #NEWLINE# #INDENT# 'aggregations' : { #NEWLINE# #INDENT# 'closed' : { #NEWLINE# #INDENT# 'doc_count' : 1 , #NEWLINE# #UNINDENT# } , #NEWLINE# 'open' : { #NEWLINE# #INDENT# 'doc_count' : 2 , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# queryset = ESQuerySet ( raw_result , deepcopy ( query ) ) #NEWLINE# self . assertEqual ( queryset . aggregations . closed . doc_count , 1 ) #NEWLINE# self . assertEqual ( queryset . aggregations . open . doc_count , 2 )