From 4c164868c46102d26d645c4da3098237af7d382d Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Thu, 24 Sep 2015 08:24:46 -0500 Subject: [PATCH] Fixup docstrings A few docstring cleanups to make the library easier to use. Change-Id: Icd3c6c11834e6488fd5782fbea666b4c8b74337c --- oslotest/mockpatch.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/oslotest/mockpatch.py b/oslotest/mockpatch.py index e9be858..f19f8ce 100644 --- a/oslotest/mockpatch.py +++ b/oslotest/mockpatch.py @@ -28,11 +28,11 @@ class _Base(fixtures.Fixture): class PatchObject(_Base): - """Deal with code around mock. + """Deal with code around :func:`mock.patch.object`. .. py:attribute:: mock - The mock. + The mock as returned by :func:`mock.patch.object`. """ @@ -42,11 +42,11 @@ class PatchObject(_Base): class Patch(_Base): - """Deal with code around mock. + """Deal with code around :func:`mock.patch`. .. py:attribute:: mock - The mock. + The mock as returned by :func:`mock.patch`. """ @@ -56,12 +56,12 @@ class Patch(_Base): class Multiple(_Base): - """Deal with code around mock.patch.multiple. + """Deal with code around :func:`mock.patch.multiple`. Pass name=value to replace obj.name with value. - Pass name= :py:attr:`Multiple.DEFAULT` to replace obj.name with a MagicMock - instance. + Pass name= :attr:`.DEFAULT` to replace obj.name with a + :class:`mock.MagicMock` instance. :param obj: Object or name containing values being mocked. :type obj: str or object @@ -69,12 +69,14 @@ class Multiple(_Base): .. py:attribute:: mock - The mock. + A :class:`dict`, where each key matches a kwarg parameter and the value + is the passed-in value or :class:`mock.MagicMock`. """ DEFAULT = mock.DEFAULT - """Triggers a MagicMock to be created for a named attribute.""" + """Triggers a :class:`mock.MagicMock` to be created for the named + attribute.""" def __init__(self, obj, **kwargs): super(Multiple, self).__init__()