Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix #140: make 'path' required for Connection.api_request.#194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -162,7 +162,7 @@ def make_request(self, method, url, data=None, content_type=None, | ||
| return self.http.request(uri=url, method=method, headers=headers, | ||
| body=data) | ||
| def api_request(self, method, path=None, query_params=None, | ||
| def api_request(self, method, path, query_params=None, | ||
| data=None, content_type=None, | ||
| api_base_url=None, api_version=None, | ||
| expect_json=True): | ||
| @@ -174,32 +174,40 @@ def api_request(self, method, path=None, query_params=None, | ||
| :type method: string | ||
| :param method: The HTTP method name (ie, ``GET``, ``POST``, etc). | ||
| Required. | ||
| :type path: string | ||
| :param path: The path to the resource (ie, ``'/b/bucket-name'``). | ||
| Required. | ||
| :type query_params: dict | ||
| :param query_params: A dictionary of keys and values to insert into | ||
| the query string of the URL. | ||
| the query string of the URL. Default is empty dict. | ||
| :type data: string | ||
| :param data: The data to send as the body of the request. | ||
| :param data: The data to send as the body of the request. Default is the | ||
| empty string. | ||
| :type content_type: string | ||
| :param content_type: The proper MIME type of the data provided. | ||
| :param content_type: The proper MIME type of the data provided. Default | ||
| is None. | ||
| :type api_base_url: string | ||
| :param api_base_url: The base URL for the API endpoint. | ||
| Typically you won't have to provide this. | ||
| Default is the standard API base URL. | ||
| :type api_version: string | ||
| :param api_version: The version of the API to call. | ||
| Typically you shouldn't provide this and instead | ||
| use the default for the library. | ||
| Default is the latest API version supported by | ||
| gcloud-python. | ||
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page. | ||
| :type expect_json: bool | ||
| :param expect_json: If True, this method will try to parse the response | ||
| as JSON and raise an exception if that cannot be done. | ||
| Default is True. | ||
| :raises: Exception if the response code is not 200 OK. | ||
| """ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -648,7 +648,7 @@ def test_save_default_object_acl_existing_set_new_passed(self): | ||
| bucket = self._makeOne(connection, NAME, metadata) | ||
| bucket.reload_default_object_acl() | ||
| self.assertTrue(bucket.save_default_object_acl(new_acl) is bucket) | ||
| # See: https://github.com/GoogleCloudPlatform/gcloud-python/issues/138 | ||
| # See: https://github.com/GoogleCloudPlatform/gcloud-python/issues/139 | ||
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page.
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page.
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page.
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page. | ||
| #self.assertEqual(list(bucket.default_object_acl), new_acl) | ||
| kw = connection._requested | ||
| self.assertEqual(len(kw), 1) | ||
| @@ -666,14 +666,12 @@ def test_clear_default_object_acl(self): | ||
| bucket = self._makeOne(connection, NAME, metadata) | ||
| bucket.reload_default_object_acl() | ||
| self.assertTrue(bucket.clear_default_object_acl() is bucket) | ||
| # See: https://github.com/GoogleCloudPlatform/gcloud-python/issues/138 | ||
| # See: https://github.com/GoogleCloudPlatform/gcloud-python/issues/139 | ||
| #self.assertEqual(list(bucket.default_object_acl), []) | ||
| kw = connection._requested | ||
| self.assertEqual(len(kw), 1) | ||
| self.assertEqual(kw[0]['method'], 'PATCH') | ||
| self.assertEqual(kw[0]['path'], '/b/%s' % NAME) | ||
| # See: https://github.com/GoogleCloudPlatform/gcloud-python/issues/139 | ||
| #self.assertEqual(list(bucket.default_object_acl), []) | ||
| #self.assertEqual(kw[0]['data'], {'defaultObjectAcl': []}) | ||
| self.assertEqual(kw[0]['query_params'], {'projection': 'full'}) | ||
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.