Fixup docstrings

A few docstring cleanups to make the library easier to use.

Change-Id: Icd3c6c11834e6488fd5782fbea666b4c8b74337c
This commit is contained in:
Brant Knudson 2015-09-24 08:24:46 -05:00
parent 1598b1fd70
commit 4c164868c4
1 changed files with 11 additions and 9 deletions

View File

@ -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__()