ÿØÿà JFIF ÿþ
ÿÛ C
ÿÛ C ÿÀ ÿÄ ÿÄ " #QrÿÄ ÿÄ & 1! A"2qQaáÿÚ ? Øy,æ/3JæÝ¹Èß²Ø5êXw²±ÉyR¾I0ó2PI¾IÌÚiMö¯þrìN&"KgX:íµnTJnLK
@!-ýùúmë;ºgµ&ó±hw¯Õ@Ü9ñ-ë.²1<yà¹ïQÐUÛ?.¦èûbß±©Ö«Âw*V) `$bØÔëXÖ-ËTÜíGÚ3ð«g §¯JxU/ÂÅv_s(Hÿ @TñJÑãõçn!ÈgfbÓc:él[ðQe9ÀPLbÃãCµm[5¿ç'ªjglåÛí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢S x?"¸¦ùYé¨ÒOÈ q`~~ÚtËU¹CÚêV I1Áß_ÿÙ
|Jc @ s d Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l Z d d l m
Z
m Z d e f d YZ d S( s`
Helpers for the OpenSSL test suite, largely copied from
U{Twisted}.
iN( t mktemp( t TestCase( t Errort _exception_from_error_queueR c B st e Z d Z d Z d d Z e Z d d Z e Z d Z e Z
d Z d Z d Z
d Z d Z RS(
s
L{TestCase} adds useful testing functionality beyond what is available
from the standard library L{unittest.TestCase}.
c C s | j d k rj xX | j D]J } t j j | rA t j | q t j j | r t j | q q Wn y t Wn? t
k
r } | j g f k r | j d t
| q n Xd S( 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 _temporaryFilest Nonet ost patht isdirt shutilt rmtreet existst unlinkR R t argst failt repr( t selft tempt e( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt tearDown s c C s2 | | 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( t failureException( R t firstt secondt msg( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt failUnlessIdentical+ s "c C s2 | | k r. | 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 ( R R R R ( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt failIfIdentical: s "c O sv y | | | } Wn@ | k
r) } | S| j d t j d | j f n X| j d | j | f d S( 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 %si s %s not raised (%r returned)N( R t syst exc_infot __name__( R t exceptiont fR
t kwargst resultt inst( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt failUnlessRaisesI s
c C s> | j d k r g | _ n t d d } | j j | | S( sQ
Pathetic substitute for twisted.trial.unittest.TestCase.mktemp.
t dirt .N( R R R t append( R R ( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyR g s
c O s | j | | S( N( t
failUnless( R t at kw( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt
assertTrues s c O s | j | | S( N( t failIf( R R' R( ( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt assertFalsew s c G sO | j | j | | j t | t | | } | j t | | d S( 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( t assertEqualR R) t
isinstancet typet assertIdentical( R t theTypet namet constructionArgst instance( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt assertConsistentType| s N( R t
__module__t __doc__R R R R/ R t assertNotIdenticalR" t assertRaisesR R R) R+ R4 ( ( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyR s ( R6 R R t os.patht tempfileR t unittestR R t OpenSSL.cryptoR R ( ( ( sD /opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/util.pyt s