Your IP : 18.222.110.31


Current Path : /lib64/python2.7/unittest/
Upload File :
Current File : //lib64/python2.7/unittest/case.pyc

�
�mec@s}dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZmZmZmZeZdZdefd��YZd	efd
��YZdefd��YZd
�Zd�Zd�Zd�Zd�Zd�Zd�Zde fd��YZ!de fd��YZ"de"fd��YZ#dS(sTest case implementationi����Ni(tresult(tstrclasst	safe_reprtunorderable_list_differencet_count_diff_all_purposet_count_diff_hashables@
Diff is %s characters long. Set self.maxDiff to None to see it.tSkipTestcBseZdZRS(s�
    Raise this exception in a test to skip it.

    Usually you can use TestCase.skipTest() or one of the skipping decorators
    instead of raising this directly.
    (t__name__t
__module__t__doc__(((s%/usr/lib64/python2.7/unittest/case.pyRst_ExpectedFailurecBseZdZd�ZRS(s\
    Raise this when a test is expected to fail.

    This is an implementation detail.
    cCs tt|�j�||_dS(N(tsuperR
t__init__texc_info(tselfR
((s%/usr/lib64/python2.7/unittest/case.pyR*s(RRR	R(((s%/usr/lib64/python2.7/unittest/case.pyR
#st_UnexpectedSuccesscBseZdZRS(s7
    The test was supposed to fail, but it didn't!
    (RRR	(((s%/usr/lib64/python2.7/unittest/case.pyR.scCs|S(N((tobj((s%/usr/lib64/python2.7/unittest/case.pyt_id4scs�fd�}|S(s&
    Unconditionally skip a test.
    csUt|ttjf�s?tj|��fd��}|}nt|_�|_|S(Ncst���dS(N(R(targstkwargs(treason(s%/usr/lib64/python2.7/unittest/case.pytskip_wrapper=s(	t
isinstancettypettypest	ClassTypet	functoolstwrapstTruet__unittest_skip__t__unittest_skip_why__(t	test_itemR(R(s%/usr/lib64/python2.7/unittest/case.pyt	decorator;s			((RR ((Rs%/usr/lib64/python2.7/unittest/case.pytskip7s
cCs|rt|�StS(s/
    Skip a test if the condition is true.
    (R!R(t	conditionR((s%/usr/lib64/python2.7/unittest/case.pytskipIfGs
cCs|st|�StS(s3
    Skip a test unless the condition is true.
    (R!R(R"R((s%/usr/lib64/python2.7/unittest/case.pyt
skipUnlessOs
cs"tj���fd��}|S(NcsAy�||�Wn#tk
r6ttj���nXt�dS(N(t	ExceptionR
tsysR
R(RR(tfunc(s%/usr/lib64/python2.7/unittest/case.pytwrapperYs

(RR(R'R(((R's%/usr/lib64/python2.7/unittest/case.pytexpectedFailureXscCs!dtjkrt|�StSdS(s
    Non-standard/downstream-only decorator for marking a specific unit test
    to be skipped when run within the %check of an rpmbuild.

    Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within
    the environment, and has no effect otherwise.
    tWITHIN_PYTHON_RPM_BUILDN(tostenvironR!R(R((s%/usr/lib64/python2.7/unittest/case.pyt_skipInRpmBuildfs
cs"tj���fd��}|S(s

    Non-standard/downstream-only decorator for marking a specific unit test
    as expected to fail within the %check of an rpmbuild.

    Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within
    the environment, and has no effect otherwise.
    cs`dtjkrOy�||�Wn#tk
rEttj���nXt�n
�||�dS(NR*(R+R,R%R
R&R
R(RR(R'(s%/usr/lib64/python2.7/unittest/case.pyR({s
	(RR(R'R(((R's%/usr/lib64/python2.7/unittest/case.pyt_expectedFailureInRpmBuildsst_AssertRaisesContextcBs,eZdZdd�Zd�Zd�ZRS(sCA context manager used to implement TestCase.assertRaises* methods.cCs"||_|j|_||_dS(N(texpectedtfailureExceptiontexpected_regexp(RR0t	test_caseR2((s%/usr/lib64/python2.7/unittest/case.pyR�s	cCs|S(N((R((s%/usr/lib64/python2.7/unittest/case.pyt	__enter__�scCs�|dkrZy|jj}Wn tk
r>t|j�}nX|jdj|���nt||j�sptS||_	|j
dkr�tS|j
}t|t
�r�tj|�}n|jt|��s�|jd|jt|�f��ntS(Ns{0} not raiseds"%s" does not match "%s"(tNoneR0RtAttributeErrortstrR1tformatt
issubclasstFalset	exceptionR2RRt
basestringtretcompiletsearchtpattern(Rtexc_typet	exc_valuettbtexc_nameR2((s%/usr/lib64/python2.7/unittest/case.pyt__exit__�s&
			N(RRR	R5RR4RE(((s%/usr/lib64/python2.7/unittest/case.pyR/�s	tTestCasecBs)eZdZeZeZd@ZdAZeZ	dd�Z
d�Zd�Zd	�Z
d
�Zed��Zed��Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdBd�Zd�Zd�Zd�Z d�Z!dBd�Z"dBd�Z#dBd�Z$d�Z%dBd �Z&d!�Z'dBd"�Z(dBd#�Z)dBd$�Z*dBdBdBd%�Z+dBdBdBd&�Z,e)Z-e*Z.e+Z/e,Z0e$Z1d'�Z2e2e)�Z3e2e*�Z4e2e+�Z5e2e,�Z6e2e$�Z7e2e&�Z8e2e#�Z9dBdBd(�Z:d)�Z;dBd*�Z<dBd+�Z=dBd,�Z>dBd-�Z?dBd.�Z@dBd/�ZAdBd0�ZBdBd1�ZCdBd2�ZDdBd3�ZEdBd4�ZFdBd5�ZGdBd6�ZHdBd7�ZIdBd8�ZJdBd9�ZKdBd:�ZLdBd;�ZMdBd<�ZNdBd=�ZOdBd>�ZPdBd?�ZQRS(CsWA 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.

    When subclassing TestCase, you can set these attributes:
    * failureException: determines which exception will be raised when
        the instance's assertion methods fail; test methods raising this
        exception will be deemed to have 'failed' rather than 'errored'.
    * longMessage: determines whether long messages (including repr of
        objects used in assert methods) will be printed on failure in *addition*
        to any explicit message passed.
    * maxDiff: sets the maximum length of a diff in failure messages
        by assert methods using difflib. It is looked up as an instance
        attribute so can be configured by individual tests if required.
    iPiiitrunTestcCs�||_d|_yt||�}Wn*tk
rQtd|j|f��nX|j|_g|_	i|_
|jtd�|jt
d�|jtd�|jtd�|jtd�y|jtd�Wntk
r�nXdS(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.
        sno such test method in %s: %stassertDictEqualtassertListEqualtassertTupleEqualtassertSetEqualtassertMultiLineEqualN(t_testMethodNameR5t_resultForDoCleanupstgetattrR6t
ValueErrort	__class__R	t_testMethodDoct	_cleanupst_type_equality_funcstaddTypeEqualityFunctdicttlistttupletsett	frozensettunicodet	NameError(Rt
methodNamet
testMethod((s%/usr/lib64/python2.7/unittest/case.pyR�s&		
		
cCs||j|<dS(s[Add a type specific assertEqual style function to compare a type.

        This method is for use by TestCase subclasses that need to register
        their own type equality functions to provide nicer error messages.

        Args:
            typeobj: The data type to call this function on when both values
                    are of the same type in assertEqual().
            function: The callable taking two arguments and an optional
                    msg= argument that raises self.failureException with a
                    useful error message when the two arguments are not equal.
        N(RT(Rttypeobjtfunction((s%/usr/lib64/python2.7/unittest/case.pyRU�s
cOs|jj|||f�dS(sAdd a function, with arguments, to be called when the test is
        completed. Functions added are called on a LIFO basis and are
        called after tearDown on test failure or success.

        Cleanup items are called even if setUp fails (unlike tearDown).N(RStappend(RR`RR((s%/usr/lib64/python2.7/unittest/case.pyt
addCleanupscCsdS(sAHook method for setting up the test fixture before exercising it.N((R((s%/usr/lib64/python2.7/unittest/case.pytsetUpscCsdS(sAHook method for deconstructing the test fixture after testing it.N((R((s%/usr/lib64/python2.7/unittest/case.pyttearDownscCsdS(sKHook method for setting up class fixture before running tests in the class.N((tcls((s%/usr/lib64/python2.7/unittest/case.pyt
setUpClassscCsdS(sVHook method for deconstructing the class fixture after running all tests in the class.N((Re((s%/usr/lib64/python2.7/unittest/case.pyt
tearDownClassscCsdS(Ni((R((s%/usr/lib64/python2.7/unittest/case.pytcountTestCasesscCs
tj�S(N(Rt
TestResult(R((s%/usr/lib64/python2.7/unittest/case.pytdefaultTestResult"scCs,|j}|r(|jd�dj�p+dS(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
iN(RRtsplittstripR5(Rtdoc((s%/usr/lib64/python2.7/unittest/case.pytshortDescription%s	cCsdt|j�|jfS(Ns%s.%s(RRQRM(R((s%/usr/lib64/python2.7/unittest/case.pytid0scCs,t|�t|�k	rtS|j|jkS(N(RtNotImplementedRM(Rtother((s%/usr/lib64/python2.7/unittest/case.pyt__eq__3scCs||kS(N((RRq((s%/usr/lib64/python2.7/unittest/case.pyt__ne__9scCstt|�|jf�S(N(thashRRM(R((s%/usr/lib64/python2.7/unittest/case.pyt__hash__<scCsd|jt|j�fS(Ns%s (%s)(RMRRQ(R((s%/usr/lib64/python2.7/unittest/case.pyt__str__?scCsdt|j�|jfS(Ns<%s testMethod=%s>(RRQRM(R((s%/usr/lib64/python2.7/unittest/case.pyt__repr__BscCsRt|dd�}|dk	r.|||�n tjdtd�|j|�dS(NtaddSkips4TestResult has no addSkip method, skips not reportedi(ROR5twarningstwarntRuntimeWarningt
addSuccess(RRRRx((s%/usr/lib64/python2.7/unittest/case.pyt_addSkipFs	
cCsr|}|dkrI|j�}t|dd�}|dk	rI|�qIn||_|j|�t||j�}t|jdt�s�t|dt�r�z;t|jdd�p�t|dd�}|j||�Wd|j	|�XdSz>t}y|j
�WnXtk
r*}|j|t|��n�t
k
r=�n�|j|tj��n�Xy|�WnBt
k
r{�n5|jk
r�|j|tj��ntk
r}t|dd�}|dk	r�|||j�q�tjdt�|j|�n�tk
ret|dd�}	|	dk	r<|	|�q�tjdt�|j|tj��nKtk
r�}|j|t|��n#|j|tj��nXt}y|j�Wn6t
k
r��n#|j|tj��t}nX|j�}
|o|
}|r%|j|�nWd|j	|�|dkrmt|d	d�}|dk	rm|�qmnXdS(
NtstartTestRunRRttaddExpectedFailures@TestResult has no addExpectedFailure method, reporting as passestaddUnexpectedSuccesssDTestResult has no addUnexpectedSuccess method, reporting as failureststopTestRun(R5RjRORNt	startTestRMRQR:R}tstopTestRcRR7tKeyboardInterrupttaddErrorR&R
R1t
addFailureR
RyRzR{R|RRRdt
doCleanups(RRtorig_resultR~R^tskip_whytsuccessteR�R�tcleanUpSuccessR�((s%/usr/lib64/python2.7/unittest/case.pytrunOs�
	


	

	


cCs�|j}t}xr|jr�|jjd�\}}}y|||�Wqtk
r]�qt}|j|tj��qXqW|S(sNExecute all cleanup functions. Normally called for you after
        tearDown.i����(	RNRRStpopR�R:R�R&R
(RRtokR`RR((s%/usr/lib64/python2.7/unittest/case.pyR��s	
cOs|j||�S(N(R�(RRtkwds((s%/usr/lib64/python2.7/unittest/case.pyt__call__�scCsc|j�t||j��|j�x5|jr^|jjd�\}}}|||�q*WdS(s6Run the test without collecting errors in a TestResulti����N(RcRORMRdRSR�(RR`RR((s%/usr/lib64/python2.7/unittest/case.pytdebug�s

cCst|��dS(sSkip this test.N(R(RR((s%/usr/lib64/python2.7/unittest/case.pytskipTest�scCs|j|��dS(s)Fail immediately, with the given message.N(R1(Rtmsg((s%/usr/lib64/python2.7/unittest/case.pytfail�scCs8|r4|j|dt|��}|j|��ndS(s#Check that the expression is false.s%s is not falseN(t_formatMessageRR1(RtexprR�((s%/usr/lib64/python2.7/unittest/case.pytassertFalse�scCs8|s4|j|dt|��}|j|��ndS(s"Check that the expression is true.s%s is not trueN(R�RR1(RR�R�((s%/usr/lib64/python2.7/unittest/case.pyt
assertTrue�scCsd|js|p|S|dkr#|Syd||fSWn(tk
r_dt|�t|�fSXdS(s�Honour the longMessage attribute when generating failure messages.
        If longMessage is False this means:
        * Use only an explicit message if it is provided
        * Otherwise use the standard message for the assert

        If longMessage is True:
        * Use the standard message
        * If an explicit message is provided, plus ' : ' and the explicit message
        s%s : %sN(tlongMessageR5tUnicodeDecodeErrorR(RR�tstandardMsg((s%/usr/lib64/python2.7/unittest/case.pyR��s
	

cOs=t||�}|dkr|S|�|||�WdQXdS(s�Fail unless an exception of class excClass is raised
           by callableObj when invoked with arguments args and keyword
           arguments kwargs. If a different type of exception is
           raised, it will not be caught, and the test case will be
           deemed to have suffered an error, exactly as for an
           unexpected exception.

           If called with callableObj omitted or None, will return a
           context object used like this::

                with self.assertRaises(SomeException):
                    do_something()

           The context manager keeps a reference to the exception as
           the 'exception' attribute. This allows you to inspect the
           exception after the assertion::

               with self.assertRaises(SomeException) as cm:
                   do_something()
               the_exception = cm.exception
               self.assertEqual(the_exception.error_code, 3)
        N(R/R5(RtexcClasstcallableObjRRtcontext((s%/usr/lib64/python2.7/unittest/case.pytassertRaises�s
cCskt|�t|�krd|jjt|��}|dk	rdt|t�r]t||�}n|Sn|jS(sGet a detailed comparison function for the types of the two args.

        Returns: A callable accepting (first, second, msg=None) that will
        raise a failure exception if first != second with a useful human
        readable error message for those types.
        N(RRTtgetR5RR<ROt_baseAssertEqual(Rtfirsttsecondtasserter((s%/usr/lib64/python2.7/unittest/case.pyt_getAssertEqualityFuncscCsP||ksLdt|�t|�f}|j||�}|j|��ndS(s:The default assertEqual implementation, not type specific.s%s != %sN(RR�R1(RR�R�R�R�((s%/usr/lib64/python2.7/unittest/case.pyR�scCs)|j||�}|||d|�dS(s[Fail if the two objects are unequal as determined by the '=='
           operator.
        R�N(R�(RR�R�R�tassertion_func((s%/usr/lib64/python2.7/unittest/case.pytassertEqual$scCsJ||ksF|j|dt|�t|�f�}|j|��ndS(sYFail if the two objects are equal as determined by the '!='
           operator.
        s%s == %sN(R�RR1(RR�R�R�((s%/usr/lib64/python2.7/unittest/case.pytassertNotEqual+scCs||krdS|dk	r7|dk	r7td��n|dk	r�t||�|kr]dSdt|�t|�t|�f}nW|dkr�d}ntt||�|�dkr�dSdt|�t|�|f}|j||�}|j|��dS(sFail 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, or by comparing that the
           between the two objects is more than the given delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most signficant digit).

           If the two objects compare equal then they will automatically
           compare almost equal.
        Ns specify delta or places not boths%s != %s within %s deltaiis%s != %s within %r places(R5t	TypeErrortabsRtroundR�R1(RR�R�tplacesR�tdeltaR�((s%/usr/lib64/python2.7/unittest/case.pytassertAlmostEqual5s&			
cCs|dk	r'|dk	r'td��n|dk	r�||krZt||�|krZdSdt|�t|�t|�f}nd|dkr�d}n||kr�tt||�|�dkr�dSdt|�t|�|f}|j||�}|j|��dS(s�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, or by comparing that the
           between the two objects is less than the given delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most signficant digit).

           Objects that are equal automatically fail.
        s specify delta or places not bothNs%s == %s within %s deltaiis%s == %s within %r places(R5R�R�RR�R�R1(RR�R�R�R�R�R�((s%/usr/lib64/python2.7/unittest/case.pytassertNotAlmostEqual[s"#		,	
cs�fd�}|S(Ncs,tjdj�j�td��||�S(NsPlease use {0} instead.i(RyRzR8RtPendingDeprecationWarning(RR(t
original_func(s%/usr/lib64/python2.7/unittest/case.pytdeprecated_func�s
((R�R�((R�s%/usr/lib64/python2.7/unittest/case.pyt
_deprecate�sc	Cs�|dk	rz|j}t||�sF|jd|t|�f��nt||�s�|jd|t|�f��q�nd}d}yt|�}Wn!ttfk
r�d|}nX|dkr�yt|�}Wq�ttfk
r�d|}q�Xn|dkr|||krdSt|�}	t|�}
t|	�dkrT|	d d}	nt|
�dkrw|
d d}
n|j�|	|
f}d	|}x�t	t
||��D]�}y||}
Wn/tttfk
r�|d
||f7}PnXy||}Wn/tttfk
r1|d||f7}PnX|
|kr�|d||
|f7}Pq�q�W||kr�|dkr�t|�t|�kr�dS||kr|d
|||f7}y|d|||f7}Wqytttfk
r|d||f7}qyXq|||kr||d|||f7}y|d|||f7}Wqytttfk
ru|d||f7}qyXq|n|}ddj
tjtj|�j�tj|�j���}|j||�}|j||�}|j|�dS(sAAn equality assertion for ordered sequences (like lists and tuples).

        For the purposes of this function, a valid ordered sequence type is one
        which can be indexed, has a length, and has an equality operator.

        Args:
            seq1: The first sequence to compare.
            seq2: The second sequence to compare.
            seq_type: The expected datatype of the sequences, or None if no
                    datatype should be enforced.
            msg: Optional message to use on failure instead of a list of
                    differences.
        sFirst sequence is not a %s: %ssSecond sequence is not a %s: %stsequences(First %s has no length.    Non-sequence?s)Second %s has no length.    Non-sequence?Nis...s%ss differ: %s != %s
s(
Unable to index element %d of first %s
s)
Unable to index element %d of second %s
s#
First differing element %d:
%s
%s
s+
First %s contains %d additional elements.
sFirst extra element %d:
%s
s'Unable to index element %d of first %s
s,
Second %s contains %d additional elements.
s(Unable to index element %d of second %s
s
(R5RRR1RtlenR�tNotImplementedErrort
capitalizetxrangetmint
IndexErrorRtjointdifflibtndifftpprinttpformatt
splitlinest_truncateMessageR�R�(Rtseq1tseq2R�tseq_typet
seq_type_namet	differingtlen1tlen2t	seq1_reprt	seq2_reprtelementstititem1titem2R�tdiffMsg((s%/usr/lib64/python2.7/unittest/case.pytassertSequenceEqual�s�			
	cCsA|j}|dks't|�|kr/||S|tt|�S(N(tmaxDiffR5R�tDIFF_OMITTED(Rtmessagetdifftmax_diff((s%/usr/lib64/python2.7/unittest/case.pyR��s	cCs|j|||dt�dS(sA list-specific equality assertion.

        Args:
            list1: The first list to compare.
            list2: The second list to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        R�N(R�RW(Rtlist1tlist2R�((s%/usr/lib64/python2.7/unittest/case.pyRIs
cCs|j|||dt�dS(sA tuple-specific equality assertion.

        Args:
            tuple1: The first tuple to compare.
            tuple2: The second tuple to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.
        R�N(R�RX(Rttuple1ttuple2R�((s%/usr/lib64/python2.7/unittest/case.pyRJs	c
Cspy|j|�}WnGtk
r9}|jd|�n$tk
r\}|jd|�nXy|j|�}WnGtk
r�}|jd|�n$tk
r�}|jd|�nX|p�|s�dSg}|r
|jd�x$|D]}|jt|��q�Wn|rD|jd�x$|D]}|jt|��q$Wndj|�}	|j|j||	��dS(s�A set-specific equality assertion.

        Args:
            set1: The first set to compare.
            set2: The second set to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        assertSetEqual uses ducktyping to support different types of sets, and
        is optimized for sets specifically (parameters must support a
        difference method).
        s/invalid type when attempting set difference: %ss2first argument does not support set difference: %ss3second argument does not support set difference: %sNs*Items in the first set but not the second:s*Items in the second set but not the first:s
(t
differenceR�R�R6RatreprR�R�(
Rtset1tset2R�tdifference1R�tdifference2tlinestitemR�((s%/usr/lib64/python2.7/unittest/case.pyRKs2




cCsH||krDdt|�t|�f}|j|j||��ndS(sDJust like self.assertTrue(a in b), but with a nicer default message.s%s not found in %sN(RR�R�(Rtmembert	containerR�R�((s%/usr/lib64/python2.7/unittest/case.pytassertInFscCsH||krDdt|�t|�f}|j|j||��ndS(sHJust like self.assertTrue(a not in b), but with a nicer default message.s%s unexpectedly found in %sN(RR�R�(RR�R�R�R�((s%/usr/lib64/python2.7/unittest/case.pytassertNotInMscCsH||k	rDdt|�t|�f}|j|j||��ndS(sDJust like self.assertTrue(a is b), but with a nicer default message.s%s is not %sN(RR�R�(Rtexpr1texpr2R�R�((s%/usr/lib64/python2.7/unittest/case.pytassertIsTscCs?||kr;dt|�f}|j|j||��ndS(sHJust like self.assertTrue(a is not b), but with a nicer default message.sunexpectedly identical: %sN(RR�R�(RR�R�R�R�((s%/usr/lib64/python2.7/unittest/case.pytassertIsNot[scCs�|j|td�|j|td�||kr�dt|t�t|t�f}ddjtjtj|�j	�tj|�j	���}|j
||�}|j|j||��ndS(Ns"First argument is not a dictionarys#Second argument is not a dictionarys%s != %ss
(
tassertIsInstanceRVRRR�R�R�R�R�R�R�R�R�(Rtd1td2R�R�R�((s%/usr/lib64/python2.7/unittest/case.pyRHas"c	Csg}g}xy|j�D]k\}}||krA|j|�q|||kr|jdt|�t|�t||�f�qqW|p�|s�dSd}|r�ddjd�|D��}n|r�|r�|d7}n|ddj|�7}n|j|j||��dS(	s0Checks whether actual is a superset of expected.s%s, expected: %s, actual: %sNRsMissing: %st,css|]}t|�VqdS(N(R(t.0tm((s%/usr/lib64/python2.7/unittest/case.pys	<genexpr>~ss; sMismatched values: %s(t	iteritemsRaRR�R�R�(	RR0tactualR�tmissingt
mismatchedtkeytvalueR�((s%/usr/lib64/python2.7/unittest/case.pytassertDictContainsSubsetms(	
c	Cs9t|�t|�}}tj���tjr_x-dddgD]}tjd|t�q?Wny"tj|�}tj|�}Wn t	k
r�t
||�}	n X||kr�dSt||�}	WdQX|	r5d}
g|	D]}d|^q�}dj|�}
|j
|
|
�}
|j||
�}|j|�ndS(	s�An unordered sequence specific comparison. It asserts that
        actual_seq and expected_seq have the same element counts.
        Equivalent to::

            self.assertEqual(Counter(iter(actual_seq)),
                             Counter(iter(expected_seq)))

        Asserts that each element has the same count in both sequences.
        Example:
            - [0, 1, 1] and [1, 0, 1] compare equal.
            - [0, 0, 1] and [0, 1] compare unequal.
        s'(code|dict|type) inequality comparisonss,builtin_function_or_method order comparisonsscomparing unequal typestignoreNsElement counts were not equal:
s First has %d, Second has %d:  %rs
(RWRytcatch_warningsR&tpy3kwarningtfilterwarningstDeprecationWarningtcollectionstCounterR�RRR�R�R�R�(Rtexpected_seqt
actual_seqR�t	first_seqt
second_seqt_msgR�R�tdifferencesR�R�R�R�((s%/usr/lib64/python2.7/unittest/case.pytassertItemsEqual�s,

	

cCsG|j|td�|j|td�||krCt|�|jks\t|�|jkrr|j|||�n|jt�}|jt�}t|�dkr�|jd�|kr�|dg}|dg}ndt|t�t|t�f}ddj	t
j||��}|j||�}|j
|j||��ndS(	s-Assert that two multi-line strings are equal.sFirst argument is not a stringsSecond argument is not a stringis
s
s%s != %sRN(R�R<R�t_diffThresholdR�R�RRlRR�R�R�R�R�R�(RR�R�R�t
firstlinestsecondlinesR�R�((s%/usr/lib64/python2.7/unittest/case.pyRL�s$'
cCsH||ksDdt|�t|�f}|j|j||��ndS(sCJust like self.assertTrue(a < b), but with a nicer default message.s%s not less than %sN(RR�R�(RtatbR�R�((s%/usr/lib64/python2.7/unittest/case.pyt
assertLess�scCsH||ksDdt|�t|�f}|j|j||��ndS(sDJust like self.assertTrue(a <= b), but with a nicer default message.s%s not less than or equal to %sN(RR�R�(RR
RR�R�((s%/usr/lib64/python2.7/unittest/case.pytassertLessEqual�scCsH||ksDdt|�t|�f}|j|j||��ndS(sCJust like self.assertTrue(a > b), but with a nicer default message.s%s not greater than %sN(RR�R�(RR
RR�R�((s%/usr/lib64/python2.7/unittest/case.pyt
assertGreater�scCsH||ksDdt|�t|�f}|j|j||��ndS(sDJust like self.assertTrue(a >= b), but with a nicer default message.s"%s not greater than or equal to %sN(RR�R�(RR
RR�R�((s%/usr/lib64/python2.7/unittest/case.pytassertGreaterEqual�scCs?|dk	r;dt|�f}|j|j||��ndS(sCSame as self.assertTrue(obj is None), with a nicer default message.s%s is not NoneN(R5RR�R�(RRR�R�((s%/usr/lib64/python2.7/unittest/case.pytassertIsNone�scCs2|dkr.d}|j|j||��ndS(s(Included for symmetry with assertIsNone.sunexpectedly NoneN(R5R�R�(RRR�R�((s%/usr/lib64/python2.7/unittest/case.pytassertIsNotNone�scCsEt||�sAdt|�|f}|j|j||��ndS(sTSame as self.assertTrue(isinstance(obj, cls)), with a nicer
        default message.s%s is not an instance of %rN(RRR�R�(RRReR�R�((s%/usr/lib64/python2.7/unittest/case.pyR��scCsEt||�rAdt|�|f}|j|j||��ndS(s,Included for symmetry with assertIsInstance.s%s is an instance of %rN(RRR�R�(RRReR�R�((s%/usr/lib64/python2.7/unittest/case.pytassertNotIsInstance�scOs@t|||�}|dkr"|S|�|||�WdQXdS(s�Asserts that the message in a raised exception matches a regexp.

        Args:
            expected_exception: Exception class expected to be raised.
            expected_regexp: Regexp (re pattern object or string) expected
                    to be found in error message.
            callable_obj: Function to be called.
            args: Extra args.
            kwargs: Extra kwargs.
        N(R/R5(Rtexpected_exceptionR2tcallable_objRRR�((s%/usr/lib64/python2.7/unittest/case.pytassertRaisesRegexp�s
cCsht|t�r!tj|�}n|j|�sd|p9d}d||j|f}|j|��ndS(s=Fail the test unless the text matches the regular expression.sRegexp didn't matchs%s: %r not found in %rN(RR<R=R>R?R@R1(RttextR2R�((s%/usr/lib64/python2.7/unittest/case.pytassertRegexpMatches	scCs�t|t�r!tj|�}n|j|�}|r�|p?d}d|||j�|j�!|j|f}|j|��ndS(s9Fail the test if the text matches the regular expression.sRegexp matcheds%s: %r matches %r in %rN(	RR<R=R>R?tstarttendR@R1(RRtunexpected_regexpR�tmatch((s%/usr/lib64/python2.7/unittest/case.pytassertNotRegexpMatchess
i�iN(RRRR	tAssertionErrorR1R:R�R�Rt_classSetupFailedRRURbRcRdtclassmethodRfRgRhRjRnRoRrRsRuRvRwR}R5R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�tassertEqualstassertNotEqualstassertAlmostEqualstassertNotAlmostEqualstassert_R�tfailUnlessEqualtfailIfEqualtfailUnlessAlmostEqualtfailIfAlmostEqualt
failUnlesstfailUnlessRaisestfailIfR�R�RIRJRKR�R�R�R�RHR�RRLRR
RRRRR�RRRR(((s%/usr/lib64/python2.7/unittest/case.pyRF�s�															Q							
&$	g	+(	tFunctionTestCasecBszeZdZdddd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�ZRS(
sIA test case that wraps a test function.

    This is useful for slipping pre-existing test functions into the
    unittest 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.
    cCs;tt|�j�||_||_||_||_dS(N(RR,Rt
_setUpFunct
_tearDownFunct	_testFunct_description(RttestFuncRcRdtdescription((s%/usr/lib64/python2.7/unittest/case.pyR)s
			cCs |jdk	r|j�ndS(N(R-R5(R((s%/usr/lib64/python2.7/unittest/case.pyRc0scCs |jdk	r|j�ndS(N(R.R5(R((s%/usr/lib64/python2.7/unittest/case.pyRd4scCs|j�dS(N(R/(R((s%/usr/lib64/python2.7/unittest/case.pyRG8scCs
|jjS(N(R/R(R((s%/usr/lib64/python2.7/unittest/case.pyRo;scCs\t||j�stS|j|jko[|j|jko[|j|jko[|j|jkS(N(RRQRpR-R.R/R0(RRq((s%/usr/lib64/python2.7/unittest/case.pyRr>scCs||kS(N((RRq((s%/usr/lib64/python2.7/unittest/case.pyRsGscCs+tt|�|j|j|j|jf�S(N(RtRR-R.R/R0(R((s%/usr/lib64/python2.7/unittest/case.pyRuJscCsdt|j�|jjfS(Ns%s (%s)(RRQR/R(R((s%/usr/lib64/python2.7/unittest/case.pyRvNscCsdt|j�|jfS(Ns<%s tec=%s>(RRQR/(R((s%/usr/lib64/python2.7/unittest/case.pyRwRscCsE|jdk	r|jS|jj}|rA|jd�dj�pDdS(Ns
i(R0R5R/R	RkRl(RRm((s%/usr/lib64/python2.7/unittest/case.pyRnVsN(RRR	R5RRcRdRGRoRrRsRuRvRwRn(((s%/usr/lib64/python2.7/unittest/case.pyR, s										($R	R�R+R&RR�R�R=RRyRRtutilRRRRRRt
__unittestR�R%RR
RRR!R#R$R)R-R.tobjectR/RFR,(((s%/usr/lib64/python2.7/unittest/case.pyt<module>s:(								
	#���x