From d9d00907069794d6149b0a00739b8a934c36c5bf Mon Sep 17 00:00:00 2001
From: Joe Gregorio
| +class BatchHttpRequest(__builtin__.object) | ||
| + | Batches multiple HttpRequest objects into a single HTTP request. | |
| + | Methods defined here: +
+Data descriptors defined here: +
| |
+
| +class HttpMock(__builtin__.object) | ||
| + | Mock of httplib2.Http | |
| + | Methods defined here: +
+Data descriptors defined here: +
| |
+
| +class HttpMockSequence(__builtin__.object) | ||
| + | Mock of httplib2.Http + +Mocks a sequence of calls to request returning different responses for each +call. Create an instance initialized with the desired response headers +and content and then use as if an httplib2.Http instance. + + http = HttpMockSequence([ + ({'status': '401'}, ''), + ({'status': '200'}, '{"access_token":"1/3w","expires_in":3600}'), + ({'status': '200'}, 'echo_request_headers'), + ]) + resp, content = http.request("http://examples.com") + +There are special values you can pass in for content to trigger +behavours that are helpful in testing. + +'echo_request_headers' means return the request headers in the response body +'echo_request_headers_as_json' means return the request headers in + the response body +'echo_request_body' means return the request body in the response body +'echo_request_uri' means return the request uri in the response body | |
| + | Methods defined here: +
+Data descriptors defined here: +
| |
+
| class HttpRequest(__builtin__.object) | ||
| @@ -71,7 +215,7 @@ Args: | ||
+
| +class HttpRequestMock(__builtin__.object) | ||
| + | Mock of HttpRequest. + +Do not construct directly, instead use RequestMockBuilder. | |
| + | Methods defined here: +
+Data descriptors defined here: +
| |
+
| +class MediaFileUpload(MediaUpload) | ||
| + | A MediaUpload for a file. + +Construct a MediaFileUpload and pass as the media_body parameter of the +method. For example, if we had a service that allowed uploading images: + + + media = MediaFileUpload('smiley.png', mimetype='image/png', chunksize=1000, + resumable=True) + service.objects().insert( + bucket=buckets['items'][0]['id'], + name='smiley.png', + media_body=media).execute() | |
| + |
+Methods defined here: +
+Static methods defined here: +
+Class methods inherited from MediaUpload: +
+Data descriptors inherited from MediaUpload: +
| |
+
| +class MediaInMemoryUpload(MediaUpload) | ||
| + | MediaUpload for a chunk of bytes. + +Construct a MediaFileUpload and pass as the media_body parameter of the +method. For example, if we had a service that allowed plain text: | |
| + |
+Methods defined here: +
+Static methods defined here: +
+Class methods inherited from MediaUpload: +
+Data descriptors inherited from MediaUpload: +
| |
+
| +class MediaUpload(__builtin__.object) | ||
| + | Describes a media object to upload. + +Base class that defines the interface of MediaUpload subclasses. | |
| + | Methods defined here: +
+Class methods defined here: +
+Data descriptors defined here: +
| |
+
| +class MediaUploadProgress(__builtin__.object) | |||
| + | Status of a resumable upload. | ||
| + | Methods defined here: +
Data descriptors defined here:
Functions | ||
| - |
| ||
| - | __all__ = ['HttpRequest', 'RequestMockBuilder', 'HttpMockset_user_agent', 'tunnel_patch'] -__author__ = 'jcgregorio@google.com (Joe Gregorio)' | ||
+
| |