
[XMc           @   s[   d  Z  d d l j Z d d l m Z d e j f d     YZ d e j f d     YZ d S(   s3   
Interfaces for Trial.

Maintainer: Jonathan Lange
iN(   t	   Attributet	   ITestCasec           B   sJ   e  Z d  Z e j d  Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   sU   
    The interface that a test case must implement in order to be used in Trial.
    s7   The exception class that is raised by failed assertionsc         C   s   d S(   sQ   
        Run the test. Should always do exactly the same thing as run().
        N(    (   t   result(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   __call__   s    c           C   s   d S(   sJ   
        Return the number of tests in this test case. Usually 1.
        N(    (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   countTestCases   s    c           C   s   d S(   sk   
        Return a unique identifier for the test, usually the fully-qualified
        Python name.
        N(    (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   id#   s    c         C   s   d S(   sj   
        Run the test, storing the results in C{result}.

        @param result: A L{TestResult}.
        N(    (   R   (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   run*   s    c           C   s   d S(   s9   
        Return a short description of the test.
        N(    (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   shortDescription2   s    (   t   __name__t
   __module__t   __doc__t   ziR    t   failureExceptionR   R   R   R   R   (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyR      s   					t	   IReporterc           B   s
  e  Z d  Z e j d  Z e j d  Z e j d  Z e j d  Z e d  Z	 e d  Z
 d   Z d   Z d	   Z d
   Z d   Z e e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   s6   
    I report results from a run of a test suite.
    sI   Deprecated in Twisted 8.0. The io-stream that this reporter will write tos'   Either 'default', 'brief', or 'verbose's7   Additional string argument passed from the command linesZ   
        A boolean indicating that this reporter would like the test run to stop.
        s\   Deprecated in Twisted 8.0. A value which will occasionally be passed to the L{write} method.sd   
        The number of tests that seem to have been run according to this
        reporter.
        c         C   s   d S(   s   
        Report the beginning of a run of a single test method.

        @param method: an object that is adaptable to ITestMethod
        N(    (   t   method(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt	   startTestR   s    c         C   s   d S(   s~   
        Report the status of a single test method

        @param method: an object that is adaptable to ITestMethod
        N(    (   R   (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   stopTestZ   s    c         C   s   d S(   s   
        Deprecated in Twisted 8.0.

        Suites which wish to appear in reporter output should call this
        before running their tests.
        N(    (   t   name(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt
   startSuiteb   s    c         C   s   d S(   s   
        Deprecated in Twisted 8.0.

        Called at the end of a suite, if and only if that suite has called
        C{startSuite}.
        N(    (   R   (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   endSuitek   s    c         C   s   d S(   s   
        Deprecated in Twisted 8.0.

        Called when the reactor has been left in a 'dirty' state

        @param errs: a list of L{twisted.python.failure.Failure}s
        N(    (   t   errs(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   cleanupErrorst   s    c         C   s   d S(   s  
        Deprecated in Twisted 8.0.

        Called when an error occurs in a setUp* or tearDown* method

        @param warn: indicates whether or not the reporter should emit a
                     warning about the error
        @type warn: Boolean
        @param printStatus: indicates whether or not the reporter should
                            print the name of the method and the status
                            message appropriate for the type of error
        @type printStatus: Boolean
        N(    (   t   userMetht   warnt   printStatus(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   upDownError~   s    c         C   s   d S(   s*   
        Record that test passed.
        N(    (   t   test(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt
   addSuccess   s    c         C   s   d S(   sI  
        Record that a test has raised an unexpected exception.

        @param test: The test that has raised an error.
        @param error: The error that the test raised. It will either be a
            three-tuple in the style of C{sys.exc_info()} or a
            L{Failure<twisted.python.failure.Failure>} object.
        N(    (   R   t   error(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   addError   s    c         C   s   d S(   sH  
        Record that a test has failed with the given failure.

        @param test: The test that has failed.
        @param failure: The failure that the test failed with. It will
            either be a three-tuple in the style of C{sys.exc_info()}
            or a L{Failure<twisted.python.failure.Failure>} object.
        N(    (   R   t   failure(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt
   addFailure   s    c         C   s   d S(   sp  
        Record that the given test failed, and was expected to do so.

        @type test: L{pyunit.TestCase}
        @param test: The test which this is about.
        @type error: L{failure.Failure}
        @param error: The error which this test failed with.
        @type todo: L{unittest.Todo}
        @param todo: The reason for the test's TODO status.
        N(    (   R   R   t   todo(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   addExpectedFailure   s    c         C   s   d S(   s  
        Record that the given test failed, and was expected to do so.

        @type test: L{pyunit.TestCase}
        @param test: The test which this is about.
        @type todo: L{unittest.Todo}
        @param todo: The reason for the test's TODO status.
        N(    (   R   R    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   addUnexpectedSuccess   s    c         C   s   d S(   s   
        Record that a test has been skipped for the given reason.

        @param test: The test that has been skipped.
        @param reason: An object that the test case has specified as the reason
            for skipping the test.
        N(    (   R   t   reason(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   addSkip   s    c           C   s   d S(   sq   
        Deprecated in Twisted 8.0, use L{done} instead.

        Present a summary of the test results.
        N(    (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   printSummary   s    c           C   s   d S(   s   
        Deprecated in Twisted 8.0, use L{done} instead.

        Present the errors that have occured during the test run. This method
        will be called after all tests have been run.
        N(    (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   printErrors   s    c         C   s   d S(   s   
        Deprecated in Twisted 8.0, use L{done} instead.

        Display a string to the user, without appending a new line.
        N(    (   t   string(    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   write   s    c         C   s   d S(   s~   
        Deprecated in Twisted 8.0, use L{done} instead.

        Display a string to the user, appending a new line.
        N(    (   R'   (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   writeln   s    c           C   s   d S(   s   
        Return a boolean indicating whether all test results that were reported
        to this reporter were successful or not.
        N(    (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   wasSuccessful   s    c           C   s   d S(   s1  
        Called when the test run is complete.

        This gives the result object an opportunity to display a summary of
        information to the user. Once you have called C{done} on an
        L{IReporter} object, you should assume that the L{IReporter} object is
        no longer usable.
        N(    (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   done   s    (   R   R	   R
   R   R    t   streamt   tbformatt   argst
   shouldStopt	   separatort   testsRunR   R   R   R   R   t   TrueR   R   R   R   R!   R"   R$   R%   R&   R(   R)   R*   R+   (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyR   9   s<   												
						
						(   R
   t   zope.interfacet	   interfaceR   R    t	   InterfaceR   R   (    (    (    s8   /usr/lib/python2.7/dist-packages/twisted/trial/itrial.pyt   <module>   s   +