#NEWLINE# def test_run_query_wo_namespace_empty_result( self ) : #NEWLINE# #INDENT# from gcloud.datastore._generated import datastore_pb2 #NEWLINE# from gcloud.datastore._generated import query_pb2 #NEWLINE# PROJECT = 'PROJECT' #NEWLINE# KIND = 'Nonesuch' #NEWLINE# CURSOR = b'\x00' #NEWLINE# q_pb = self . _make_query_pb ( KIND ) #NEWLINE# rsp_pb = datastore_pb2 . RunQueryResponse ( ) #NEWLINE# rsp_pb . batch . end_cursor = CURSOR #NEWLINE# no_more = query_pb2 . QueryResultBatch . NO_MORE_RESULTS #NEWLINE# rsp_pb . batch . more_results = no_more #NEWLINE# rsp_pb . batch . entity_result_type = query_pb2 . EntityResult . FULL #NEWLINE# conn = self . _makeOne ( ) #NEWLINE# URI = '/' . join ( [ conn . api_base_url , conn . API_VERSION , 'projects' , ( PROJECT + ':runQuery' ) ] ) #NEWLINE# http = conn . _http = Http ( { #NEWLINE# #INDENT# 'status' : '200' , #NEWLINE# #UNINDENT# } , rsp_pb . SerializeToString ( ) ) #NEWLINE# ( pbs , end , more , skipped ) = conn . run_query ( PROJECT , q_pb ) #NEWLINE# self . assertEqual ( pbs , [ ] ) #NEWLINE# self . assertEqual ( end , CURSOR ) #NEWLINE# self . assertTrue ( more ) #NEWLINE# self . assertEqual ( skipped , 0 ) #NEWLINE# cw = http . _called_with #NEWLINE# self . _verifyProtobufCall ( cw , URI , conn ) #NEWLINE# rq_class = datastore_pb2 . RunQueryRequest #NEWLINE# request = rq_class ( ) #NEWLINE# request . ParseFromString ( cw [ 'body' ] ) #NEWLINE# self . assertEqual ( request . partition_id . namespace_id , '' ) #NEWLINE# self . assertEqual ( request . query , cw )