1<?xml version="1.0" encoding="ascii"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 3 "DTD/xhtml1-transitional.dtd"> 4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5<head> 6 <title>googleapiclient.http.HttpRequestMock</title> 7 <link rel="stylesheet" href="epydoc.css" type="text/css" /> 8 <script type="text/javascript" src="epydoc.js"></script> 9</head> 10 11<body bgcolor="white" text="black" link="blue" vlink="#204080" 12 alink="#204080"> 13<!-- ==================== NAVIGATION BAR ==================== --> 14<table class="navbar" border="0" width="100%" cellpadding="0" 15 bgcolor="#a0c0ff" cellspacing="0"> 16 <tr valign="middle"> 17 <!-- Home link --> 18 <th> <a 19 href="googleapiclient-module.html">Home</a> </th> 20 21 <!-- Tree link --> 22 <th> <a 23 href="module-tree.html">Trees</a> </th> 24 25 <!-- Index link --> 26 <th> <a 27 href="identifier-index.html">Indices</a> </th> 28 29 <!-- Help link --> 30 <th> <a 31 href="help.html">Help</a> </th> 32 33 <th class="navbar" width="100%"></th> 34 </tr> 35</table> 36<table width="100%" cellpadding="0" cellspacing="0"> 37 <tr valign="top"> 38 <td width="100%"> 39 <span class="breadcrumbs"> 40 <a href="googleapiclient-module.html">Package googleapiclient</a> :: 41 <a href="googleapiclient.http-module.html">Module http</a> :: 42 Class HttpRequestMock 43 </span> 44 </td> 45 <td> 46 <table cellpadding="0" cellspacing="0"> 47 <!-- hide/show private --> 48 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" 49 onclick="toggle_private();">hide private</a>]</span></td></tr> 50 <tr><td align="right"><span class="options" 51 >[<a href="frames.html" target="_top">frames</a 52 >] | <a href="googleapiclient.http.HttpRequestMock-class.html" 53 target="_top">no frames</a>]</span></td></tr> 54 </table> 55 </td> 56 </tr> 57</table> 58<!-- ==================== CLASS DESCRIPTION ==================== --> 59<h1 class="epydoc">Class HttpRequestMock</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.http-pysrc.html#HttpRequestMock">source code</a></span></p> 60<center> 61 62</center> 63<hr /> 64<pre class="literalblock"> 65Mock of HttpRequest. 66 67Do not construct directly, instead use RequestMockBuilder. 68 69</pre> 70 71<!-- ==================== INSTANCE METHODS ==================== --> 72<a name="section-InstanceMethods"></a> 73<table class="summary" border="1" cellpadding="3" 74 cellspacing="0" width="100%" bgcolor="white"> 75<tr bgcolor="#70b0f0" class="table-header"> 76 <td colspan="2" class="table-header"> 77 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 78 <tr valign="top"> 79 <td align="left"><span class="table-header">Instance Methods</span></td> 80 <td align="right" valign="top" 81 ><span class="options">[<a href="#section-InstanceMethods" 82 class="privatelink" onclick="toggle_private();" 83 >hide private</a>]</span></td> 84 </tr> 85 </table> 86 </td> 87</tr> 88<tr> 89 <td width="15%" align="right" valign="top" class="summary"> 90 <span class="summary-type"> </span> 91 </td><td class="summary"> 92 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 93 <tr> 94 <td><span class="summary-sig"><a href="googleapiclient.http.HttpRequestMock-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, 95 <span class="summary-sig-arg">resp</span>, 96 <span class="summary-sig-arg">content</span>, 97 <span class="summary-sig-arg">postproc</span>)</span><br /> 98 Constructor for HttpRequestMock</td> 99 <td align="right" valign="top"> 100 <span class="codelink"><a href="googleapiclient.http-pysrc.html#HttpRequestMock.__init__">source code</a></span> 101 102 </td> 103 </tr> 104 </table> 105 106 </td> 107 </tr> 108<tr> 109 <td width="15%" align="right" valign="top" class="summary"> 110 <span class="summary-type"> </span> 111 </td><td class="summary"> 112 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 113 <tr> 114 <td><span class="summary-sig"><a href="googleapiclient.http.HttpRequestMock-class.html#execute" class="summary-sig-name">execute</a>(<span class="summary-sig-arg">self</span>, 115 <span class="summary-sig-arg">http</span>=<span class="summary-sig-default">None</span>)</span><br /> 116 Execute the request.</td> 117 <td align="right" valign="top"> 118 <span class="codelink"><a href="googleapiclient.http-pysrc.html#HttpRequestMock.execute">source code</a></span> 119 120 </td> 121 </tr> 122 </table> 123 124 </td> 125 </tr> 126 <tr> 127 <td colspan="2" class="summary"> 128 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 129 <code>__delattr__</code>, 130 <code>__format__</code>, 131 <code>__getattribute__</code>, 132 <code>__hash__</code>, 133 <code>__new__</code>, 134 <code>__reduce__</code>, 135 <code>__reduce_ex__</code>, 136 <code>__repr__</code>, 137 <code>__setattr__</code>, 138 <code>__sizeof__</code>, 139 <code>__str__</code>, 140 <code>__subclasshook__</code> 141 </p> 142 </td> 143 </tr> 144</table> 145<!-- ==================== PROPERTIES ==================== --> 146<a name="section-Properties"></a> 147<table class="summary" border="1" cellpadding="3" 148 cellspacing="0" width="100%" bgcolor="white"> 149<tr bgcolor="#70b0f0" class="table-header"> 150 <td colspan="2" class="table-header"> 151 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 152 <tr valign="top"> 153 <td align="left"><span class="table-header">Properties</span></td> 154 <td align="right" valign="top" 155 ><span class="options">[<a href="#section-Properties" 156 class="privatelink" onclick="toggle_private();" 157 >hide private</a>]</span></td> 158 </tr> 159 </table> 160 </td> 161</tr> 162 <tr> 163 <td colspan="2" class="summary"> 164 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 165 <code>__class__</code> 166 </p> 167 </td> 168 </tr> 169</table> 170<!-- ==================== METHOD DETAILS ==================== --> 171<a name="section-MethodDetails"></a> 172<table class="details" border="1" cellpadding="3" 173 cellspacing="0" width="100%" bgcolor="white"> 174<tr bgcolor="#70b0f0" class="table-header"> 175 <td colspan="2" class="table-header"> 176 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 177 <tr valign="top"> 178 <td align="left"><span class="table-header">Method Details</span></td> 179 <td align="right" valign="top" 180 ><span class="options">[<a href="#section-MethodDetails" 181 class="privatelink" onclick="toggle_private();" 182 >hide private</a>]</span></td> 183 </tr> 184 </table> 185 </td> 186</tr> 187</table> 188<a name="__init__"></a> 189<div> 190<table class="details" border="1" cellpadding="3" 191 cellspacing="0" width="100%" bgcolor="white"> 192<tr><td> 193 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 194 <tr valign="top"><td> 195 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, 196 <span class="sig-arg">resp</span>, 197 <span class="sig-arg">content</span>, 198 <span class="sig-arg">postproc</span>)</span> 199 <br /><em class="fname">(Constructor)</em> 200 </h3> 201 </td><td align="right" valign="top" 202 ><span class="codelink"><a href="googleapiclient.http-pysrc.html#HttpRequestMock.__init__">source code</a></span> 203 </td> 204 </tr></table> 205 206 <pre class="literalblock"> 207Constructor for HttpRequestMock 208 209Args: 210 resp: httplib2.Response, the response to emulate coming from the request 211 content: string, the response body 212 postproc: callable, the post processing function usually supplied by 213 the model class. See model.JsonModel.response() as an example. 214 215</pre> 216 <dl class="fields"> 217 <dt>Overrides: 218 object.__init__ 219 </dt> 220 </dl> 221</td></tr></table> 222</div> 223<a name="execute"></a> 224<div> 225<table class="details" border="1" cellpadding="3" 226 cellspacing="0" width="100%" bgcolor="white"> 227<tr><td> 228 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 229 <tr valign="top"><td> 230 <h3 class="epydoc"><span class="sig"><span class="sig-name">execute</span>(<span class="sig-arg">self</span>, 231 <span class="sig-arg">http</span>=<span class="sig-default">None</span>)</span> 232 </h3> 233 </td><td align="right" valign="top" 234 ><span class="codelink"><a href="googleapiclient.http-pysrc.html#HttpRequestMock.execute">source code</a></span> 235 </td> 236 </tr></table> 237 238 <pre class="literalblock"> 239Execute the request. 240 241Same behavior as HttpRequest.execute(), but the response is 242mocked and not really from an HTTP request/response. 243 244</pre> 245 <dl class="fields"> 246 </dl> 247</td></tr></table> 248</div> 249<br /> 250<!-- ==================== NAVIGATION BAR ==================== --> 251<table class="navbar" border="0" width="100%" cellpadding="0" 252 bgcolor="#a0c0ff" cellspacing="0"> 253 <tr valign="middle"> 254 <!-- Home link --> 255 <th> <a 256 href="googleapiclient-module.html">Home</a> </th> 257 258 <!-- Tree link --> 259 <th> <a 260 href="module-tree.html">Trees</a> </th> 261 262 <!-- Index link --> 263 <th> <a 264 href="identifier-index.html">Indices</a> </th> 265 266 <!-- Help link --> 267 <th> <a 268 href="help.html">Help</a> </th> 269 270 <th class="navbar" width="100%"></th> 271 </tr> 272</table> 273<table border="0" cellpadding="0" cellspacing="0" width="100%%"> 274 <tr> 275 <td align="left" class="footer"> 276 Generated by Epydoc 3.0.1 on Mon Jun 5 13:38:40 2017 277 </td> 278 <td align="right" class="footer"> 279 <a target="mainFrame" href="http://epydoc.sourceforge.net" 280 >http://epydoc.sourceforge.net</a> 281 </td> 282 </tr> 283</table> 284 285<script type="text/javascript"> 286 <!-- 287 // Private objects are initially displayed (because if 288 // javascript is turned off then we want them to be 289 // visible); but by default, we want to hide them. So hide 290 // them unless we have a cookie that says to show them. 291 checkCookie(); 292 // --> 293</script> 294</body> 295</html> 296