Part of twisted.trial.unittest View Source View In Hierarchy
Known subclasses: twisted.trial.unittest.TestCase
Replaces many of the built-in TestCase assertions. In general, these 
assertions provide better error messages and are easier to use in 
callbacks. Also provides new assertions such as failUnlessFailure.
| Method | fail | absolutely fails the test, do not pass go, do not collect $200 | 
| Method | failIf | fails the test if conditionevaluates to False | 
| Method | failUnless | fails the test if conditionevaluates to True | 
| Method | failUnlessRaises | fails the test unless calling the function fwith the givenargsandkwargsraisesexception. 
The failure will report the traceback and call stack of the unexpected 
exception. | 
| Method | failUnlessEqual | Fail the test if firstandsecondare not 
equal. | 
| Method | failUnlessIdentical | fail the test if firstis notsecond. This is 
an obect-identity-equality test, not an object equality (i.e.__eq__) test | 
| Method | failIfIdentical | fail the test if firstissecond. This is an 
obect-identity-equality test, not an object equality (i.e.__eq__) test | 
| Method | failIfEqual | fail the test if first==second | 
| Method | failUnlessIn | fail the test if containeeis not found incontainer | 
| Method | failIfIn | fail the test if containeeis found incontainer | 
| Method | failIfAlmostEqual | Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. | 
| Method | failUnlessAlmostEqual | Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. | 
| Method | failUnlessApproximates | asserts that first-second>tolerance | 
| Method | failUnlessFailure | Assert that deferredwill errback with one ofexpectedFailures.  Returns the original Deferred with 
callbacks added. You will need to return this Deferred from your test 
case. | 
| Method | failUnlessSubstring | Undocumented | 
| Method | failIfSubstring | Undocumented | 
| Method | failUnlessWarns | Fail if the given function doesn't generate the specified warning when called. It calls the function, checks the warning, and forwards the result of the function if everything is fine. | 
| Method | failUnlessIsInstance | Assert that the given instance is of the given class or of one of the given classes. | 
| Method | failIfIsInstance | Assert that the given instance is not of the given class or of one of the given classes. | 
| Parameters | msg | the message that will be displayed as the reason for the failure | 
condition evaluates to False
| Parameters | condition | any object that defines __nonzero__ | 
condition evaluates to True
| Parameters | condition | any object that defines __nonzero__ | 
f with the given
args and kwargs raises exception. 
The failure will report the traceback and call stack of the unexpected 
exception.
| Parameters | exception | exception type that is to be expected | 
| f | the function to call | |
| Returns | The raised exception instance, if it is of the given type. | |
| Raises | self.failureException | Raised if the function call does not raise an exception or if it raises an exception of a different type. | 
first and second are not 
equal.
| Parameters | msg | A string describing the failure that's included in the exception. | 
first is not second. This is 
an obect-identity-equality test, not an object equality (i.e. 
__eq__) test
| Parameters | msg | if msg is None, then the failure message will be '%r is not %r' % (first, second) | 
first is second. This is an 
obect-identity-equality test, not an object equality (i.e. 
__eq__) test
| Parameters | msg | if msg is None, then the failure message will be '%r is %r' % (first, second) | 
first == second
| Parameters | msg | if msg is None, then the failure message will be '%r == %r' % (first, second) | 
containee is not found in 
container
| Parameters | containee | the value that should be in container | 
| container | a sequence type, or in the case of a mapping type, will follow semantics of 'if key in dict.keys()' | |
| msg | if msg is None, then the failure message will be '%r not in %r' % (first, second) | 
containee is found in 
container
| Parameters | containee | the value that should not be in container | 
| container | a sequence type, or in the case of a mapping type, will follow semantics of 'if key in dict.keys()' | |
| msg | if msg is None, then the failure message will be '%r in %r' % (first, second) | 
| Notes | decimal places (from zero) is usually not the same as significant digits (measured from the most signficant digit). | |
| included for compatiblity with PyUnit test cases | ||
| Notes | decimal places (from zero) is usually not the same as significant digits (measured from the most signficant digit). | |
| included for compatiblity with PyUnit test cases | ||
first - second > 
tolerance
| Parameters | msg | if msg is None, then the failure message will be '%r ~== %r' % (first, second) | 
deferred will errback with one of 
expectedFailures.  Returns the original Deferred with 
callbacks added. You will need to return this Deferred from your test 
case.
| Parameters | category | the category of the warning to check. | 
| message | the output message of the warning to check. | |
| filename | the filename where the warning should come from. | |
| f | the function which is supposed to generate the warning. (type: any callable. ) | |
| args | the arguments to f. | |
| kwargs | the keywords arguments to f. | |
| Returns | the result of the original function f. | |
| Parameters | instance | the object to test the type (first argument of the isinstancecall).
 (type: any.
) | 
| classOrTuple | the class or classes to test against (second argument of the isinstancecall).
 (type: class, type, or tuple.
) | 
| Parameters | instance | the object to test the type (first argument of the isinstancecall).
 (type: any.
) | 
| classOrTuple | the class or classes to test against (second argument of the isinstancecall).
 (type: class, type, or tuple.
) |