HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/OpenSSL/test/test_rand.pyo
�
�|�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@