From 470d76d13871c15154cee1d01981793438e85bc6 Mon Sep 17 00:00:00 2001 From: Duan Jiong Date: Thu, 23 Mar 2017 13:43:37 +0800 Subject: [PATCH] Fix some reST field lists in docstrings Probably the most common format for documenting arguments is reST field lists [1]. This change updates some docstrings to comply with the field lists syntax. [1] http://sphinx-doc.org/domains.html#info-field-lists Change-Id: I2f48183114b0f41dd9da18b7244219772844391c --- barbican/tests/utils.py | 2 +- functionaltests/api/v1/behaviors/ca_behaviors.py | 4 ++-- functionaltests/api/v1/behaviors/order_behaviors.py | 4 ++-- functionaltests/api/v1/models/base_models.py | 8 ++++---- functionaltests/common/client.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/barbican/tests/utils.py b/barbican/tests/utils.py index 5aeaa254..d4674290 100644 --- a/barbican/tests/utils.py +++ b/barbican/tests/utils.py @@ -584,7 +584,7 @@ def create_timestamp_w_tz_and_offset(timezone=None, days=0, hours=0, minutes=0, :param hours: The offset in hours :param minutes: The offset in minutes - :return a timestamp + :return: a timestamp """ if timezone is None: timezone = time.strftime("%z") diff --git a/functionaltests/api/v1/behaviors/ca_behaviors.py b/functionaltests/api/v1/behaviors/ca_behaviors.py index 41e824da..192f8cee 100644 --- a/functionaltests/api/v1/behaviors/ca_behaviors.py +++ b/functionaltests/api/v1/behaviors/ca_behaviors.py @@ -85,7 +85,7 @@ class CABehaviors(base_behaviors.BaseBehaviors): :param user_name: The user name used to create the subCA :param admin: The user with permissions to delete the subCA :return: A tuple containing the response from the create - and the href to the newly created subCA + and the href to the newly created subCA """ resp = self.client.post('cas', request_model=model, @@ -113,7 +113,7 @@ class CABehaviors(base_behaviors.BaseBehaviors): :param expected_fail: If test is expected to fail the deletion :param use_auth: Boolean for whether to send authentication headers :param user_name: The user name used to delete the entity - :return A request response object + :return: A request response object """ resp = self.client.delete(ca_ref, extra_headers=extra_headers, use_auth=use_auth, user_name=user_name) diff --git a/functionaltests/api/v1/behaviors/order_behaviors.py b/functionaltests/api/v1/behaviors/order_behaviors.py index 11a2254e..56e94dd8 100644 --- a/functionaltests/api/v1/behaviors/order_behaviors.py +++ b/functionaltests/api/v1/behaviors/order_behaviors.py @@ -80,7 +80,7 @@ class OrderBehaviors(base_behaviors.BaseBehaviors): :param extra_headers: Optional HTTP headers to add to the request :param user_name: the user used to do the get :param use_auth: Boolean to determine whether auth headers are sent - :return the response, a list of orders and the next/pref hrefs + :return: the response, a list of orders and the next/pref hrefs """ params = {'limit': limit, 'offset': offset} @@ -116,7 +116,7 @@ class OrderBehaviors(base_behaviors.BaseBehaviors): list for housekeeping. :param user_name: the user used to do the delete :param use_auth: Boolean to determine whether auth headers are sent - :return A request response object + :return: A request response object """ resp = self.client.delete(order_ref, extra_headers=extra_headers, user_name=user_name, use_auth=use_auth) diff --git a/functionaltests/api/v1/models/base_models.py b/functionaltests/api/v1/models/base_models.py index e6de2ac2..68ff34f0 100644 --- a/functionaltests/api/v1/models/base_models.py +++ b/functionaltests/api/v1/models/base_models.py @@ -32,7 +32,7 @@ class BaseModel(object): def obj_to_json(self): """Convert this object to a JSON string. - :return A string of JSON containing the fields in this object + :return: A string of JSON containing the fields in this object """ return json.dumps(self.obj_to_dict()) @@ -43,7 +43,7 @@ class BaseModel(object): If there are fields that are not set in this object then those will NOT have entries in the returned dict. - :return A dict representing this model + :return: A dict representing this model """ the_dict = self.__dict__ retval = self._remove_empty_fields_from_dict(the_dict) @@ -72,7 +72,7 @@ class BaseModel(object): """Create a model from a JSON string. :param serialized_str: the JSON string - :return a secret object + :return: a secret object """ try: json_dict = json.loads(serialized_str) @@ -86,6 +86,6 @@ class BaseModel(object): """Create an object from a dict. :param input_dict: A dict of fields. - :return a model object build from the passed in dict. + :return: a model object build from the passed in dict. """ return cls(**input_dict) diff --git a/functionaltests/common/client.py b/functionaltests/common/client.py index 97afab8f..9bfbedae 100644 --- a/functionaltests/common/client.py +++ b/functionaltests/common/client.py @@ -202,7 +202,7 @@ class BarbicanClient(object): :param item_list: the json returned from a barbican GET request for a list of objects :param model_type: The model used in the creation of the list of models - :return A list of models and the refs for next and previous lists. + :return: A list of models and the refs for next and previous lists. """ models, next_ref, prev_ref = [], None, None