-
<c       s    d  Z  - / d Z 0 d Z 1 d d d !Z 3 d k Z 4 d k Z 5 d k Z 6 d k Z 7 d k Z 8 d k	 Z	 > d f  d     YZ
 x d	 f  d
     YZ 3d f  d     YZ ad e f d     YZ d f  d     YZ e   Z e d  Z e d  Z d e e d  Z d e e d  Z d f  d     YZ d e
 f d     YZ Rd f  d     YZ d f  d     YZ e Z e d j o e d e  n d S(    s~  
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework.

This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting the results
 (TextTestRunner).

Simple usage:

    import unittest

    class IntegerArithmenticTestCase(unittest.TestCase):
        def testAdd(self):  ## test method names begin 'test*'
            self.assertEquals((1 + 2), 3)
            self.assertEquals(0 + 1, 1)
        def testMultiply(self):
            self.assertEquals((0 * 10), 0)
            self.assertEquals((5 * 8), 40)

    if __name__ == '__main__':
        unittest.main()

Further information is available in the bundled documentation, and from

  http://pyunit.sourceforge.net/

Copyright (c) 1999, 2000, 2001 Steve Purcell
This module is free software, and you may redistribute it and/or modify
it under the same terms as Python itself, so long as this copyright message
and disclaimer are retained in their original form.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
s   Steve Purcells    stephen_purcell at yahoo dot coms   $Revision: 1.14 $i   iNs
   TestResultc      s   > t  Z d  Z H I d   Z O d   Z S d   Z W d   Z ] d   Z b d   Z f d   Z	 j d   Z
 n d	   Z r d
   Z RS(   s  Holder for test result information.

    Test results are automatically managed by the TestCase and TestSuite
    classes, and do not need to be explicitly manipulated by writers of tests.

    Each instance holds the total number of tests run, and collections of
    failures and errors that occurred among those test runs. The collections
    contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
    formatted traceback of the error that occurred.
    c    s7   I J g  |  _ K g  |  _ L d |  _ M d |  _ d  S(   Ni    (   s   selfs   failuress   errorss   testsRuns
   shouldStop(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   __init__I s   c    s   O P Q |  i d |  _ d S(   s-   Called when the given test is about to be runi   N(   s   selfs   testsRun(   s   selfs   test(    (    s   /usr/lib/python2.2/unittest.pys	   startTestO s   c    s   S T U d S(   s'   Called when the given test has been runN(    (   s   selfs   test(    (    s   /usr/lib/python2.2/unittest.pys   stopTestS s   c    s,   W Z [ |  i i | |  i |  f  d S(   sm   Called when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().
        N(   s   selfs   errorss   appends   tests   _exc_info_to_strings   err(   s   selfs   tests   err(    (    s   /usr/lib/python2.2/unittest.pys   addErrorW s   c    s,   ] _ ` |  i i | |  i |  f  d S(   sd   Called when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().N(   s   selfs   failuress   appends   tests   _exc_info_to_strings   err(   s   selfs   tests   err(    (    s   /usr/lib/python2.2/unittest.pys
   addFailure] s   c    s   b c d d S(   s-   Called when a test has completed successfullyN(    (   s   selfs   test(    (    s   /usr/lib/python2.2/unittest.pys
   addSuccessb s   c    s:   f g h t  |  i  t  |  i  j o
 d j n Sd S(   s.   Tells whether or not this result was a successi    N(   s   lens   selfs   failuress   errors(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   wasSuccessfulf s   c    s   j k l d |  _ d S(   s*   Indicates that the tests should be abortedi   N(   s   selfs
   shouldStop(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   stopj s   c    s)   n o p t  i t t i |  d  Sd S(   s>   Converts a sys.exc_info()-style tuple of values into a string.s    N(   s   strings   joins   applys	   tracebacks   format_exceptions   err(   s   selfs   err(    (    s   /usr/lib/python2.2/unittest.pys   _exc_info_to_stringn s   c    s6   r s d |  i |  i t |  i  t |  i  f Sd  S(   Ns!   <%s run=%i errors=%i failures=%i>(   s   selfs	   __class__s   testsRuns   lens   errorss   failures(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   __repr__r s   (   s   __name__s
   __module__s   __doc__s   __init__s	   startTests   stopTests   addErrors
   addFailures
   addSuccesss   wasSuccessfuls   stops   _exc_info_to_strings   __repr__(    (    (    s   /usr/lib/python2.2/unittest.pys
   TestResult> s   
s   TestCasec      sE  x t  Z d  Z   e Z  d d  Z  d   Z  d   Z  d   Z  d   Z	  d   Z
  d   Z  d	   Z  d
   Z  e d  Z  e d  Z  d   Z  d   Z  e d  Z  e d  Z e d  Z d   Z e d  Z !e d  Z )e Z Z +e Z Z -e Z /e Z RS(   s  A class whose instances are single test cases.

    By default, the test code itself should be placed in a method named
    'runTest'.

    If the fixture may be used for many test cases, create as
    many test methods as are needed. When instantiating such a TestCase
    subclass, specify in the constructor arguments the name of the test method
    that the instance is to execute.

    Test authors should subclass TestCase for their own tests. Construction
    and deconstruction of the test's environment ('fixture') can be
    implemented by overriding the 'setUp' and 'tearDown' methods respectively.

    If it is necessary to override the __init__ method, the base class
    __init__ method must always be called. It is important that subclasses
    should not change the signature of their __init__ method, since instances
    of the classes are instantiated automatically by parts of the framework
    in order to be run.
    s   runTestc    sp      y1  | |  _  t |  |  }  | i |  _ Wn/  t j
 o   t d |  i	 | f  n Xd S(   s   Create an instance of the class that will use the named test
           method when executed. Raises a ValueError if the instance does
           not have a method with the specified name.
        s   no such test method in %s: %sN(
   s
   methodNames   selfs   _TestCase__testMethodNames   getattrs
   testMethods   __doc__s   _TestCase__testMethodDocs   AttributeErrors
   ValueErrors	   __class__(   s   selfs
   methodNames
   testMethod(    (    s   /usr/lib/python2.2/unittest.pys   __init__ s   c    s      d S(   sA   Hook method for setting up the test fixture before exercising it.N(    (   s   self(    (    s   /usr/lib/python2.2/unittest.pys   setUp s   c    s      d S(   sA   Hook method for deconstructing the test fixture after testing it.N(    (   s   self(    (    s   /usr/lib/python2.2/unittest.pys   tearDown s   c    s     d Sd  S(   Ni   (    (   s   self(    (    s   /usr/lib/python2.2/unittest.pys   countTestCases s   c    s     t    Sd  S(   N(   s
   TestResult(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   defaultTestResult s   c    sD      |  i }  | o t i t i | d  d  p t Sd S(   s   Returns a one-line description of the test, or None if no
        description has been provided.

        The default implementation of this method returns the first line of
        the specified test method's docstring.
        s   
i    N(   s   selfs   _TestCase__testMethodDocs   docs   strings   strips   splits   None(   s   selfs   doc(    (    s   /usr/lib/python2.2/unittest.pys   shortDescription s   c    s     d |  i |  i f Sd  S(   Ns   %s.%s(   s   selfs	   __class__s   _TestCase__testMethodName(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   id s   c    s     d |  i |  i f Sd  S(   Ns   %s (%s)(   s   selfs   _TestCase__testMethodNames	   __class__(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   __str__ s   c    s     d |  i |  i f Sd  S(   Ns   <%s testMethod=%s>(   s   selfs	   __class__s   _TestCase__testMethodName(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   __repr__ s   c    s     |  |  Sd  S(   N(   s   selfs   result(   s   selfs   result(    (    s   /usr/lib/python2.2/unittest.pys   run s   c    s    | t j o  |  i   } n  | i |    t |  |  i  }  zs y  |  i   WnE  t	 j
 o    n+   | i
 |  |  i     d  Sn X d }  y  |    d } Wnq  |  i j
 o" }  | i |  |  i    n?  t	 j
 o    n$   | i
 |  |  i    n X y  |  i   WnG  t	 j
 o    n-   | i
 |  |  i     d } n X | o  | i |   n Wd    | i |   Xd  S(   Ni    i   (   s   results   Nones   selfs   defaultTestResults	   startTests   getattrs   _TestCase__testMethodNames
   testMethods   setUps   KeyboardInterrupts   addErrors   _TestCase__exc_infos   oks   failureExceptions   es
   addFailures   tearDowns
   addSuccesss   stopTest(   s   selfs   results   es   oks
   testMethod(    (    s   /usr/lib/python2.2/unittest.pys   __call__ sB    
	



 c    s:      |  i    t |  |  i     |  i   d S(   s6   Run the test without collecting errors in a TestResultN(   s   selfs   setUps   getattrs   _TestCase__testMethodNames   tearDown(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   debug s   c    s      t  i   \ } } }  t  i d  d j o  | | | f Sn  | i }  | t j o  | | | f Sn  | | | f Sd S(   s   Return a version of sys.exc_info() with the traceback frame
           minimised; usually the top level of the traceback frame is not
           needed.
        i   s   javaN(	   s   syss   exc_infos   exctypes   excvalues   tbs   platforms   tb_nexts   newtbs   None(   s   selfs   exctypes   excvalues   newtbs   tb(    (    s   /usr/lib/python2.2/unittest.pys
   __exc_info s   c    s      |  i |  d S(   s)   Fail immediately, with the given message.N(   s   selfs   failureExceptions   msg(   s   selfs   msg(    (    s   /usr/lib/python2.2/unittest.pys   fail s   c    s'    | o |  i |  n d S(   s(   Fail the test if the expression is true.N(   s   exprs   selfs   failureExceptions   msg(   s   selfs   exprs   msg(    (    s   /usr/lib/python2.2/unittest.pys   failIf s   
 c    s(   | o |  i |  n d S(   s,   Fail the test unless the expression is true.N(   s   exprs   selfs   failureExceptions   msg(   s   selfs   exprs   msg(    (    s   /usr/lib/python2.2/unittest.pys
   failUnlesss    c    s   y t  | | |  Wn | j
 o d SnC Xt | d  o | i } n t |  } |  i
 |  d S(   si  Fail unless an exception of class excClass is thrown
           by callableObj when invoked with arguments args and keyword
           arguments kwargs. If a different type of exception is
           thrown, it will not be caught, and the test case will be
           deemed to have suffered an error, exactly as for an
           unexpected exception.
        Ns   __name__(   s   applys   callableObjs   argss   kwargss   excClasss   hasattrs   __name__s   excNames   strs   selfs   failureException(   s   selfs   excClasss   callableObjs   argss   kwargss   excName(    (    s   /usr/lib/python2.2/unittest.pys   failUnlessRaisess    c    s@   | | j o& |  i | p d | | f  n d S(   s[   Fail if the two objects are unequal as determined by the '!='
           operator.
        s   %s != %sN(   s   firsts   seconds   selfs   failureExceptions   msg(   s   selfs   firsts   seconds   msg(    (    s   /usr/lib/python2.2/unittest.pys   failUnlessEquals   c    s@   !$%| | j o& &|  i | p d | | f  n d S(   sY   Fail if the two objects are equal as determined by the '=='
           operator.
        s   %s == %sN(   s   firsts   seconds   selfs   failureExceptions   msg(   s   selfs   firsts   seconds   msg(    (    s   /usr/lib/python2.2/unittest.pys   failIfEqual!s   (   s   __name__s
   __module__s   __doc__s   AssertionErrors   failureExceptions   __init__s   setUps   tearDowns   countTestCasess   defaultTestResults   shortDescriptions   ids   __str__s   __repr__s   Nones   runs   __call__s   debugs   _TestCase__exc_infos   fails   failIfs
   failUnlesss   failUnlessRaisess   failUnlessEquals   failIfEquals   assertEquals   assertEqualss   assertNotEquals   assertNotEqualss   assertRaisess   assert_(    (    (    s   /usr/lib/python2.2/unittest.pys   TestCasex s2   	
#	s	   TestSuitec      s   3t  Z d  Z ;<f  d  Z @d   Z Ce Z Ed   Z Kd   Z Nd   Z Rd   Z	 Ud   Z
 \d   Z RS(	   s  A test suite is a composite test consisting of a number of TestCases.

    For use, create an instance of TestSuite, then add test case instances.
    When all tests have been added, the suite can be passed to a test
    runner, such as TextTestRunner. It will run the individual test cases
    in the order in which they were added, aggregating the results. When
    subclassing, do not forget to call the base class constructor.
    c    s#   <=g  |  _ >|  i |  d  S(   N(   s   selfs   _testss   addTestss   tests(   s   selfs   tests(    (    s   /usr/lib/python2.2/unittest.pys   __init__<s   c    s   @Ad |  i |  i f Sd  S(   Ns   <%s tests=%s>(   s   selfs	   __class__s   _tests(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   __repr__@s   c    sD   EFd } Gx' |  i DG] } H| | i   } q WI| Sd  S(   Ni    (   s   casess   selfs   _testss   tests   countTestCases(   s   selfs   tests   cases(    (    s   /usr/lib/python2.2/unittest.pys   countTestCasesEs
   	 	c    s   KL|  i i |  d  S(   N(   s   selfs   _testss   appends   test(   s   selfs   test(    (    s   /usr/lib/python2.2/unittest.pys   addTestKs   c    s.   NOx! | DO] } P|  i |  q Wd  S(   N(   s   testss   tests   selfs   addTest(   s   selfs   testss   test(    (    s   /usr/lib/python2.2/unittest.pys   addTestsNs   
 	c    s   RS|  |  Sd  S(   N(   s   selfs   result(   s   selfs   result(    (    s   /usr/lib/python2.2/unittest.pys   runRs   c    sJ   UVx6 |  i DV]( } W| i o XPn Y| |  q WZ| Sd  S(   N(   s   selfs   _testss   tests   results
   shouldStop(   s   selfs   results   test(    (    s   /usr/lib/python2.2/unittest.pys   __call__Us    	c    s1   \]^x! |  i D^] } ^| i   q Wd S(   s7   Run the tests without collecting errors in a TestResultN(   s   selfs   _testss   tests   debug(   s   selfs   test(    (    s   /usr/lib/python2.2/unittest.pys   debug\s    	 (   s   __name__s
   __module__s   __doc__s   __init__s   __repr__s   __str__s   countTestCasess   addTests   addTestss   runs   __call__s   debug(    (    (    s   /usr/lib/python2.2/unittest.pys	   TestSuite3s   	s   FunctionTestCasec      s}   at  Z d  Z hje e e d  Z rd   Z vd   Z zd   Z }d   Z d   Z	 d   Z
 d   Z RS(	   sG  A test case that wraps a test function.

    This is useful for slipping pre-existing test functions into the
    PyUnit framework. Optionally, set-up and tidy-up functions can be
    supplied. As with TestCase, the tidy-up ('tearDown') function will
    always be called if the set-up ('setUp') function ran successfully.
    c    sG   jlt  i |   m| |  _ n| |  _ o| |  _ p| |  _
 d  S(   N(   s   TestCases   __init__s   selfs   setUps   _FunctionTestCase__setUpFuncs   tearDowns   _FunctionTestCase__tearDownFuncs   testFuncs   _FunctionTestCase__testFuncs   descriptions   _FunctionTestCase__description(   s   selfs   testFuncs   setUps   tearDowns   description(    (    s   /usr/lib/python2.2/unittest.pys   __init__js
   c    s+   rs|  i t j	 o t|  i   n d  S(   N(   s   selfs   _FunctionTestCase__setUpFuncs   None(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   setUprs   c    s+   vw|  i t j	 o x|  i   n d  S(   N(   s   selfs   _FunctionTestCase__tearDownFuncs   None(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   tearDownvs   c    s   z{|  i   d  S(   N(   s   selfs   _FunctionTestCase__testFunc(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   runTestzs   c    s   }~|  i i Sd  S(   N(   s   selfs   _FunctionTestCase__testFuncs   __name__(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   id}s   c    s!   d |  i |  i i f Sd  S(   Ns   %s (%s)(   s   selfs	   __class__s   _FunctionTestCase__testFuncs   __name__(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   __str__s   c    s   d |  i |  i f Sd  S(   Ns   <%s testFunc=%s>(   s   selfs	   __class__s   _FunctionTestCase__testFunc(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   __repr__s   c    se   |  i t j	 o |  i Sn |  i i } | o t i t i | d  d  p t Sd  S(   Ns   
i    (	   s   selfs   _FunctionTestCase__descriptions   Nones   _FunctionTestCase__testFuncs   __doc__s   docs   strings   strips   split(   s   selfs   doc(    (    s   /usr/lib/python2.2/unittest.pys   shortDescriptions    (   s   __name__s
   __module__s   __doc__s   Nones   __init__s   setUps   tearDowns   runTests   ids   __str__s   __repr__s   shortDescription(    (    (    s   /usr/lib/python2.2/unittest.pys   FunctionTestCaseas   s
   TestLoaderc      sq   t  Z d  Z d Z e Z e Z d   Z d   Z	 e
 d  Z e
 d  Z d   Z RS(   sw   This class is responsible for loading tests according to various
    criteria and returning them wrapped in a Test
    s   testc    s/   |  i t | |  i |    Sd S(   s<   Return a suite of all tests cases contained in testCaseClassN(   s   selfs
   suiteClasss   maps   testCaseClasss   getTestCaseNames(   s   selfs   testCaseClass(    (    s   /usr/lib/python2.2/unittest.pys   loadTestsFromTestCases   c    s   g  } xo t |  D]^ } t | |  } t |  t i j o t	 | t
  o | i |  i |   n q W|  i |  Sd S(   s?   Return a suite of all tests cases contained in the given moduleN(   s   testss   dirs   modules   names   getattrs   objs   types   typess	   ClassTypes
   issubclasss   TestCases   appends   selfs   loadTestsFromTestCases
   suiteClass(   s   selfs   modules   testss   objs   name(    (    s   /usr/lib/python2.2/unittest.pys   loadTestsFromModules   	 	)!c 	   s3  t  i | d  } | t j o | o t d |  n | } xm | ob y# t t  i	 | d   } PWn5 t
 j
 o& | d =| o
   n n XqZ W| d } n | } x# | D] } t | |  } q Wd k } t |  t i j o |  i |  Sn t |  t i j o t | | i  o |  i |  Sn t |  t i j o | i | i  Sn} t |  o\ |   } t | | i  o t | | i  o t d | | f  n | Sn t d |  d S(   sT  Return a suite of all tests cases given a string specifier.

        The name may resolve either to a module, a test case class, a
        test method within a test case class, or a callable object which
        returns a TestCase or TestSuite instance.

        The method optionally resolves the names relative to a given module.
        s   .s   incomplete test name: %sii   Ns"   calling %s returned %s, not a tests$   don't know how to make test from: %s(   s   strings   splits   names   partss   modules   Nones
   ValueErrors
   parts_copys
   __import__s   joins   ImportErrors   objs   parts   getattrs   unittests   types   typess
   ModuleTypes   selfs   loadTestsFromModules	   ClassTypes
   issubclasss   TestCases   loadTestsFromTestCases   UnboundMethodTypes   im_classs   __name__s   callables   tests
   isinstances	   TestSuite(	   s   selfs   names   modules   objs
   parts_copys   partss   unittests   tests   part(    (    s   /usr/lib/python2.2/unittest.pys   loadTestsFromNamesB   
 

 	
 	,+c    sV   g  } x- | D]" } | i |  i | |   q W|  i |  Sd S(   s   Return a suite of all tests cases found using the given sequence
        of string specifiers. See 'loadTestsFromName()'.
        N(   s   suitess   namess   names   appends   selfs   loadTestsFromNames   modules
   suiteClass(   s   selfs   namess   modules   suitess   name(    (    s   /usr/lib/python2.2/unittest.pys   loadTestsFromNamess   	
 	 c    s   t  |  i d  t |   } xX | i D]J } x> |  i |  D]* } | | j o | i
 |  n qS Wq7 W|  i o | i |  i  n | Sd S(   sL   Return a sorted sequence of method names found within testCaseClass
        c    s   |  t |   | j S(   N(   s   ns   lens   p(   s   ns   p(    (    s   /usr/lib/python2.2/unittest.pys   <lambda>s    N(   s   filters   selfs   testMethodPrefixs   dirs   testCaseClasss   testFnNamess	   __bases__s	   baseclasss   getTestCaseNamess
   testFnNames   appends   sortTestMethodsUsings   sort(   s   selfs   testCaseClasss
   testFnNames   testFnNamess	   baseclass(    (    s   /usr/lib/python2.2/unittest.pys   getTestCaseNamess    	 	(   s   __name__s
   __module__s   __doc__s   testMethodPrefixs   cmps   sortTestMethodsUsings	   TestSuites
   suiteClasss   loadTestsFromTestCases   loadTestsFromModules   Nones   loadTestsFromNames   loadTestsFromNamess   getTestCaseNames(    (    (    s   /usr/lib/python2.2/unittest.pys
   TestLoaders   				,	c    sL   t    } | | _ |  | _ | o | | _ n | Sd  S(   N(   s
   TestLoaders   loaders	   sortUsings   sortTestMethodsUsings   prefixs   testMethodPrefixs
   suiteClass(   s   prefixs	   sortUsings
   suiteClasss   loader(    (    s   /usr/lib/python2.2/unittest.pys   _makeLoaders   
 c    s    t  | |  i |   Sd  S(   N(   s   _makeLoaders   prefixs	   sortUsings   getTestCaseNamess   testCaseClass(   s   testCaseClasss   prefixs	   sortUsing(    (    s   /usr/lib/python2.2/unittest.pys   getTestCaseNamess   s   testc    s#   t  | | |  i |   Sd  S(   N(   s   _makeLoaders   prefixs	   sortUsings
   suiteClasss   loadTestsFromTestCases   testCaseClass(   s   testCaseClasss   prefixs	   sortUsings
   suiteClass(    (    s   /usr/lib/python2.2/unittest.pys	   makeSuites   c    s#    t  | | |  i |   Sd  S(   N(   s   _makeLoaders   prefixs	   sortUsings
   suiteClasss   loadTestsFromModules   module(   s   modules   prefixs	   sortUsings
   suiteClass(    (    s   /usr/lib/python2.2/unittest.pys   findTestCasess   s   _WritelnDecoratorc      s8   t  Z d  Z 	d   Z d   Z d   Z RS(   s@   Used to decorate file-like objects with a handy 'writeln' methodc    s   	
| |  _  d  S(   N(   s   streams   self(   s   selfs   stream(    (    s   /usr/lib/python2.2/unittest.pys   __init__	s   c    s   t  |  i |  Sd  S(   N(   s   getattrs   selfs   streams   attr(   s   selfs   attr(    (    s   /usr/lib/python2.2/unittest.pys   __getattr__s   c    s8   | o t |  i |  n |  i d  d  S(   Ns   
(   s   argss   applys   selfs   write(   s   selfs   args(    (    s   /usr/lib/python2.2/unittest.pys   writelns   
 (   s   __name__s
   __module__s   __doc__s   __init__s   __getattr__s   writeln(    (    (    s   /usr/lib/python2.2/unittest.pys   _WritelnDecorators   s   _TextTestResultc      s   t  Z d  Z d d Z d d Z d   Z #d   Z )d   Z /d   Z 6d   Z	 =d	   Z
 Dd
   Z Jd   Z RS(   sh   A test result class that can print formatted text results to a stream.

    Used by TextTestRunner.
    s   =iF   s   -c    sS   t  i |   | |  _ | d j |  _  | d j |  _ !| |  _ d  S(   Ni   (   s
   TestResults   __init__s   selfs   streams	   verbositys   showAlls   dotss   descriptions(   s   selfs   streams   descriptionss	   verbosity(    (    s   /usr/lib/python2.2/unittest.pys   __init__s
   c    s?   #$|  i o %| i   p
 t |  Sn 't |  Sd  S(   N(   s   selfs   descriptionss   tests   shortDescriptions   str(   s   selfs   test(    (    s   /usr/lib/python2.2/unittest.pys   getDescription#s   c    sZ   )*t  i |  |  +|  i o3 ,|  i i |  i |   -|  i i d  n d  S(   Ns    ... (   s
   TestResults	   startTests   selfs   tests   showAlls   streams   writes   getDescription(   s   selfs   test(    (    s   /usr/lib/python2.2/unittest.pys	   startTest)s   c    sb   /0t  i |  |  1|  i o 2|  i i d  n% 3|  i o 4|  i i d  n d  S(   Ns   oks   .(	   s
   TestResults
   addSuccesss   selfs   tests   showAlls   streams   writelns   dotss   write(   s   selfs   test(    (    s   /usr/lib/python2.2/unittest.pys
   addSuccess/s
   c    se   67t  i |  | |  8|  i o 9|  i i d  n% :|  i o ;|  i i	 d  n d  S(   Ns   ERRORs   E(
   s
   TestResults   addErrors   selfs   tests   errs   showAlls   streams   writelns   dotss   write(   s   selfs   tests   err(    (    s   /usr/lib/python2.2/unittest.pys   addError6s
   c    se   =>t  i |  | |  ?|  i o @|  i i d  n% A|  i o B|  i i	 d  n d  S(   Ns   FAILs   F(
   s
   TestResults
   addFailures   selfs   tests   errs   showAlls   streams   writelns   dotss   write(   s   selfs   tests   err(    (    s   /usr/lib/python2.2/unittest.pys
   addFailure=s
   c    s^   DE|  i p |  i o F|  i i   n G|  i d |  i  H|  i d |  i  d  S(   Ns   ERRORs   FAIL(   s   selfs   dotss   showAlls   streams   writelns   printErrorLists   errorss   failures(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   printErrorsDs   c    s   JKx | DK]u \ } } L|  i i |  i  M|  i i d | |  i |  f  N|  i i |  i	  O|  i i d |  q Wd  S(   Ns   %s: %ss   %s(
   s   errorss   tests   errs   selfs   streams   writelns
   separator1s   flavours   getDescriptions
   separator2(   s   selfs   flavours   errorss   tests   err(    (    s   /usr/lib/python2.2/unittest.pys   printErrorListJs   
 &(   s   __name__s
   __module__s   __doc__s
   separator1s
   separator2s   __init__s   getDescriptions	   startTests
   addSuccesss   addErrors
   addFailures   printErrorss   printErrorList(    (    (    s   /usr/lib/python2.2/unittest.pys   _TextTestResults   s   TextTestRunnerc      sD   Rt  Z d  Z WXe i d d d  Z ]d   Z `d   Z RS(   s   A test runner class that displays results in textual form.

    It prints out the names of tests as they are run, errors as they
    occur, and a summary of the results at the end of the test run.
    i   c    s1   XYt  |  |  _ Z| |  _ [| |  _ d  S(   N(   s   _WritelnDecorators   streams   selfs   descriptionss	   verbosity(   s   selfs   streams   descriptionss	   verbosity(    (    s   /usr/lib/python2.2/unittest.pys   __init__Xs   c    s#   ]^t  |  i |  i |  i  Sd  S(   N(   s   _TextTestResults   selfs   streams   descriptionss	   verbosity(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   _makeResult]s   c 	   s  `ab|  i   } ct i   } d| |  et i   } ft | |  } g| i	   h|  i
 i | i  i| i } j|  i
 i d | | d j o d p d | f  l|  i
 i   m| i   o n|  i
 i d  ot t | i | i f  \ } } p| o q|  i
 i d |  n r| o< s| o s|  i
 i d  n t|  i
 i d |  n u|  i
 i d	  n w|  i
 i d
  x| Sd S(   s&   Run the given test case or test suite.s   Ran %d test%s in %.3fsi   s    s   ss   FAILED (s   failures=%ds   , s	   errors=%ds   )s   OKN(   s   selfs   _makeResults   results   times	   startTimes   tests   stopTimes   floats	   timeTakens   printErrorss   streams   writelns
   separator2s   testsRuns   runs   wasSuccessfuls   writes   maps   lens   failuress   errorss   faileds   errored(	   s   selfs   tests   runs	   timeTakens   faileds   stopTimes   results	   startTimes   errored(    (    s   /usr/lib/python2.2/unittest.pys   run`s.   4$


 (   s   __name__s
   __module__s   __doc__s   syss   stderrs   __init__s   _makeResults   run(    (    (    s   /usr/lib/python2.2/unittest.pys   TextTestRunnerRs   s   TestProgramc      sk   t  Z d  Z d Z d e e e e d  Z e d  Z d   Z d   Z	 d   Z
 RS(   s   A command-line program that runs a set of tests; this is primarily
       for making test modules conveniently executable.
    s  Usage: %(progName)s [options] [test] [...]

Options:
  -h, --help       Show this message
  -v, --verbose    Verbose output
  -q, --quiet      Minimal output

Examples:
  %(progName)s                               - run default set of tests
  %(progName)s MyTestSuite                   - run suite 'MyTestSuite'
  %(progName)s MyTestCase.testSomething      - run MyTestCase.testSomething
  %(progName)s MyTestCase                    - run all 'test*' test methods
                                               in MyTestCase
s   __main__c    s  t  |  t  d  j oU t |  |  _ x9 t i | d  d D] } t |  i |  |  _ qK Wn | |  _ | t	 j o t
 i } n d |  _ | |  _ | |  _ | |  _ t i i | d  |  _ |  i |  |  i   d  S(   Ns    s   .i   i    (   s   types   modules
   __import__s   selfs   strings   splits   parts   getattrs   argvs   Nones   syss	   verbositys   defaultTests
   testRunners
   testLoaders   oss   paths   basenames   progNames	   parseArgss   runTests(   s   selfs   modules   defaultTests   argvs
   testRunners
   testLoaders   part(    (    s   /usr/lib/python2.2/unittest.pys   __init__s    	 c    s?   | o | GHn |  i |  i GHt i d  d  S(   Ni   (   s   msgs   selfs   USAGEs   __dict__s   syss   exit(   s   selfs   msg(    (    s   /usr/lib/python2.2/unittest.pys	   usageExits   
 c    s  d  k  } yV| i  | d d d d d g  \ } } x | D] \ } } | d d d f j o |  i   n | d	 d
 f j o d |  _ n | d d f j o d |  _ n qM Wt	 |  d j o |  i
 t j o& |  i i |  i  |  _ d  Sn t	 |  d j o | |  _ n |  i
 f |  _ |  i   Wn+ | i j
 o } |  i |  n Xd  S(   Ni   s   hHvqs   helps   verboses   quiets   -hs   -Hs   --helps   -qs   --quieti    s   -vs	   --verbosei   (   s   getopts   argvs   optionss   argss   opts   values   selfs	   usageExits	   verbositys   lens   defaultTests   Nones
   testLoaders   loadTestsFromModules   modules   tests	   testNamess   createTestss   errors   msg(   s   selfs   argvs   opts   values   msgs   getopts   argss   options(    (    s   /usr/lib/python2.2/unittest.pys	   parseArgss*   
 &c    s+   |  i i |  i |  i  |  _ d  S(   N(   s   selfs
   testLoaders   loadTestsFromNamess	   testNamess   modules   test(   s   self(    (    s   /usr/lib/python2.2/unittest.pys   createTestss   c    se   |  i t j o t d |  i  |  _ n |  i i |  i  } t i	 | i
    d  S(   Ns	   verbosity(   s   selfs
   testRunners   Nones   TextTestRunners	   verbositys   runs   tests   results   syss   exits   wasSuccessful(   s   selfs   result(    (    s   /usr/lib/python2.2/unittest.pys   runTestss   (   s   __name__s
   __module__s   __doc__s   USAGEs   Nones   defaultTestLoaders   __init__s	   usageExits	   parseArgss   createTestss   runTests(    (    (    s   /usr/lib/python2.2/unittest.pys   TestPrograms   	s   __main__s   module(   s   __doc__s
   __author__s	   __email__s   __version__s   times   syss	   tracebacks   strings   oss   typess
   TestResults   TestCases	   TestSuites   FunctionTestCases
   TestLoaders   defaultTestLoaders   Nones   _makeLoaders   cmps   getTestCaseNamess	   makeSuites   findTestCasess   _WritelnDecorators   _TextTestResults   TextTestRunners   TestPrograms   mains   __name__(   s   mains   TestPrograms   strings	   makeSuites   _WritelnDecorators
   __author__s   syss	   __email__s   FunctionTestCases   getTestCaseNamess   typess   defaultTestLoaders	   TestSuites   _TextTestResults   __version__s
   TestResults   _makeLoaders	   tracebacks   findTestCasess   TestCases   times
   TestLoaders   oss   TextTestRunner(    (    s   /usr/lib/python2.2/unittest.pys   ?- s4   		:.0Z>.K	