%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyo

�
�|�Jc@s�dZddlZddlZddlZddlmZddlmZddlZddl	m
Z
mZdefd��YZdS(s`
Helpers for the OpenSSL test suite, largely copied from
U{Twisted<http://twistedmatrix.com/>}.
i����N(tmktemp(tTestCase(tErrort_exception_from_error_queueRcBsteZdZd�Zd	d�ZeZd	d�ZeZd�Z	e	Z
d	Zd�Zd�Z
d�Zd�ZRS(
s�
    L{TestCase} adds useful testing functionality beyond what is available
    from the standard library L{unittest.TestCase}.
    cCs�|jdk	rjxX|jD]J}tjj|�rAtj|�qtjj|�rtj|�qqWnyt	�Wn?t
k
r�}|jgfkr�|jdt
|��q�nXdS(s�
        Clean up any files or directories created using L{TestCase.mktemp}.
        Subclasses must invoke this method if they override it or the
        cleanup will not occur.
        s)Left over errors in OpenSSL error queue: N(t_temporaryFilestNonetostpathtisdirtshutiltrmtreetexiststunlinkRRtargstfailtrepr(tselfttempte((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyttearDownscCs2||k	r.|j|p%d||f��n|S(s
        Fail the test if C{first} is not C{second}.  This is an
        obect-identity-equality test, not an object equality
        (i.e. C{__eq__}) test.

        @param msg: if msg is None, then the failure message will be
        '%r is not %r' % (first, second)
        s%r is not %r(tfailureException(Rtfirsttsecondtmsg((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pytfailUnlessIdentical+s	"cCs2||kr.|j|p%d||f��n|S(s
        Fail the test if C{first} is C{second}.  This is an
        obect-identity-equality test, not an object equality
        (i.e. C{__eq__}) test.

        @param msg: if msg is None, then the failure message will be
        '%r is %r' % (first, second)
        s%r is %r(R(RRRR((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pytfailIfIdentical:s	"cOsvy|||�}Wn@|k
r)}|S|jdtj�d|jf��nX|jd|j|f��dS(s9
        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.

        @param exception: exception type that is to be expected
        @param f: the function to call

        @return: The raised exception instance, if it is of the given type.
        @raise self.failureException: Raised if the function call does
            not raise an exception or if it raises an exception of a
            different type.
        s%s raised instead of %sis%s not raised (%r returned)N(Rtsystexc_infot__name__(Rt	exceptiontfR
tkwargstresulttinst((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pytfailUnlessRaisesIs	
	cCs>|jdkrg|_ntdd�}|jj|�|S(sQ
        Pathetic substitute for twisted.trial.unittest.TestCase.mktemp.
        tdirt.N(RRRtappend(RR((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyRgs
cOs|j||�S(N(t
failUnless(Rtatkw((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt
assertTruesscOs|j||�S(N(tfailIf(RR'R(((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pytassertFalsewscGsO|j|j|�|jt|t��||�}|jt|�|�dS(s
        Perform various assertions about C{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
            create an instance of it.
        N(tassertEqualRR)t
isinstancettypetassertIdentical(RttheTypetnametconstructionArgstinstance((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pytassertConsistentType|sN(Rt
__module__t__doc__RRRR/RtassertNotIdenticalR"tassertRaisesRRR)R+R4(((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyRs					(R6R	Rtos.pathttempfileRtunittestRRtOpenSSL.cryptoRR(((sD/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt<module>s

Zerion Mini Shell 1.0