#NEWLINE# def test_w_http_connections_hit( self ) : #NEWLINE# #INDENT# from gcloud._testing import _Monkey #NEWLINE# from gcloud.streaming import http_wrapper as MUT #NEWLINE# INFO = { #NEWLINE# #INDENT# 'status' : '200' , #NEWLINE# #UNINDENT# } #NEWLINE# CONTENT = 'CONTENT' #NEWLINE# CONN_TYPE = object ( ) #NEWLINE# _http = _Http ( ( INFO , CONTENT ) ) #NEWLINE# _http . connections = { #NEWLINE# #INDENT# 'http' : CONN_TYPE , #NEWLINE# #UNINDENT# } #NEWLINE# _httplib2 = _Dummy ( debuglevel = 1 ) #NEWLINE# _request = _Request ( ) #NEWLINE# _checked = [ ] #NEWLINE# with _Monkey ( MUT , httplib2 = _httplib2 ) : #NEWLINE# #INDENT# response = self . _callFUT ( _http , _request , check_response_func = _checked . append ) #NEWLINE# #UNINDENT# self . assertTrue ( isinstance ( response , MUT . Response ) ) #NEWLINE# self . assertEqual ( response . info , INFO ) #NEWLINE# self . assertEqual ( response . content , CONTENT ) #NEWLINE# self . assertEqual ( response . request_url , _request . url ) #NEWLINE# self . assertEqual ( _checked , [ response ] ) #NEWLINE# self . _verify_requested ( _http , _request , connection_type = CONN_TYPE )