summaryrefslogtreecommitdiff
path: root/oslotest
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2015-09-24 08:24:46 -0500
committerBrant Knudson <bknudson@us.ibm.com>2015-09-24 08:25:08 -0500
commit4c164868c46102d26d645c4da3098237af7d382d (patch)
tree50233b8d1d97798f3304e7a83060ab557dda3e69 /oslotest
parent1598b1fd700766627c9525010626bd719ed47b38 (diff)
downloadoslotest-4c164868c46102d26d645c4da3098237af7d382d.tar.gz
Fixup docstrings
A few docstring cleanups to make the library easier to use. Change-Id: Icd3c6c11834e6488fd5782fbea666b4c8b74337c
Diffstat (limited to 'oslotest')
-rw-r--r--oslotest/mockpatch.py20
1 files 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__()