Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/Crypto/SelfTest/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/Crypto/SelfTest/__init__.pyc


T:Nc@sdZdZddlZddlZddlmZdefdYZddddddZid	Z	e
d
krdZejdd
ndS(sgSelf tests

These tests should perform quickly and can ideally be used every time an
application runs.
s$Id$iN(tStringIOt
SelfTestErrorcBseZdZRS(cCs)tj|||||_||_dS(N(t	Exceptiont__init__tmessagetresult(tselfRR((s</usr/lib/python2.7/dist-packages/Crypto/SelfTest/__init__.pyR&s	(t__name__t
__module__R(((s</usr/lib/python2.7/dist-packages/Crypto/SelfTest/__init__.pyR%sic	Ks|dkri}ntj}|dkr[|dkrKtd|}n|j|n4|dkr|j|jd|ntd|dkrt|d<ntjd||}|j|}|j	s|dkrt
jj|j
ntd|n|S(s6Execute self-tests.

    This raises SelfTestError if any test is unsuccessful.

    You may optionally pass in a sub-module of SelfTest if you only want to
    perform some of the tests.  For example, the following would test only the
    hash modules:

        Crypto.SelfTest.run(Crypto.SelfTest.Hash)

    tconfigs5'module' and 'tests' arguments are mutually exclusivetstreamt	verbositysSelf-test failedN(tNonetunittestt	TestSuitet	get_teststaddTestst
ValueErrorRtTextTestRunnertrunt
wasSuccessfultsyststderrtwritetgetvalueR(	tmoduleRR
ttestsR	tkwargstsuitetrunnerR((s</usr/lib/python2.7/dist-packages/Crypto/SelfTest/__init__.pyR+s&	cCsg}ddlm}||jd|7}ddlm}||jd|7}ddlm}||jd|7}ddlm}||jd|7}ddlm}||jd|7}ddlm}||jd|7}|S(	Ni(tCipherR	(tHash(tProtocol(t	PublicKey(tRandom(tUtil(tCrypto.SelfTestRRRR R!R"R#(R	RRRR R!R"R#((s</usr/lib/python2.7/dist-packages/Crypto/SelfTest/__init__.pyRMst__main__cCstjtS(N(R
RR(((s</usr/lib/python2.7/dist-packages/Crypto/SelfTest/__init__.pyt<lambda>XstdefaultTestR(
t__doc__t__revision__RR
RRRRRRRRtmain(((s</usr/lib/python2.7/dist-packages/Crypto/SelfTest/__init__.pyt<module>s"