summaryrefslogtreecommitdiff
path: root/OpenSSL/test/util.py
diff options
context:
space:
mode:
authorJonathan Ballet <jon@multani.info>2011-07-16 14:14:58 +0900
committerJonathan Ballet <jon@multani.info>2011-07-16 14:14:58 +0900
commit648875f669d28a889671fd93fc6b1fec8613c056 (patch)
treea2353c5e2a896b0a71bcce2779e74ea152ada45e /OpenSSL/test/util.py
parent78b92a2f68ec960563e90c86bb41a2d128d0d1c8 (diff)
downloadpyopenssl-648875f669d28a889671fd93fc6b1fec8613c056.tar.gz
Fix markup to be compatible with Sphinx and add rough API doc
Diffstat (limited to 'OpenSSL/test/util.py')
-rw-r--r--OpenSSL/test/util.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/OpenSSL/test/util.py b/OpenSSL/test/util.py
index ac9190e..79da76b 100644
--- a/OpenSSL/test/util.py
+++ b/OpenSSL/test/util.py
@@ -27,12 +27,12 @@ else:
class TestCase(TestCase):
"""
- L{TestCase} adds useful testing functionality beyond what is available
- from the standard library L{unittest.TestCase}.
+ :py:class:`TestCase` adds useful testing functionality beyond what is available
+ from the standard library :py:class:`unittest.TestCase`.
"""
def tearDown(self):
"""
- Clean up any files or directories created using L{TestCase.mktemp}.
+ Clean up any files or directories created using :py:meth:`TestCase.mktemp`.
Subclasses must invoke this method if they override it or the
cleanup will not occur.
"""
@@ -52,9 +52,9 @@ class TestCase(TestCase):
def failUnlessIn(self, containee, container, msg=None):
"""
- Fail the test if C{containee} is not found in C{container}.
+ Fail the test if :py:data:`containee` is not found in :py:data:`container`.
- :param containee: the value that should be in C{container}
+ :param containee: the value that should be in :py:class:`container`
:param container: a sequence type, or in the case of a mapping type,
will follow semantics of 'if key in dict.keys()'
:param msg: if msg is None, then the failure message will be
@@ -68,9 +68,9 @@ class TestCase(TestCase):
def failUnlessIdentical(self, first, second, msg=None):
"""
- Fail the test if C{first} is not C{second}. This is an
+ Fail the test if :py:data:`first` is not :py:data:`second`. This is an
obect-identity-equality test, not an object equality
- (i.e. C{__eq__}) test.
+ (i.e. :py:func:`__eq__`) test.
:param msg: if msg is None, then the failure message will be
'%r is not %r' % (first, second)
@@ -83,9 +83,9 @@ class TestCase(TestCase):
def failIfIdentical(self, first, second, msg=None):
"""
- Fail the test if C{first} is C{second}. This is an
+ Fail the test if :py:data:`first` is :py:data:`second`. This is an
obect-identity-equality test, not an object equality
- (i.e. C{__eq__}) test.
+ (i.e. :py:func:`__eq__`) test.
:param msg: if msg is None, then the failure message will be
'%r is %r' % (first, second)
@@ -98,9 +98,10 @@ class TestCase(TestCase):
def failUnlessRaises(self, exception, f, *args, **kwargs):
"""
- Fail the test unless calling the function C{f} with the given
- C{args} and C{kwargs} raises C{exception}. The failure will report
- the traceback and call stack of the unexpected exception.
+ Fail the test unless calling the function :py:data:`f` with the given
+ :py:data:`args` and :py:data:`kwargs` raises :py:data:`exception`. The
+ failure will report the traceback and call stack of the unexpected
+ exception.
:param exception: exception type that is to be expected
:param f: the function to call
@@ -150,14 +151,14 @@ class TestCase(TestCase):
# Other stuff
def assertConsistentType(self, theType, name, *constructionArgs):
"""
- Perform various assertions about C{theType} to ensure that it is a
+ Perform various assertions about :py:data:`theType` to ensure that it is a
well-defined type. This is useful for extension types, where it's
pretty easy to do something wacky. If something about the type is
unusual, an exception will be raised.
:param theType: The type object about which to make assertions.
:param name: A string giving the name of the type.
- :param constructionArgs: Positional arguments to use with C{theType} to
+ :param constructionArgs: Positional arguments to use with :py:data:`theType` to
create an instance of it.
"""
self.assertEqual(theType.__name__, name)