| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/dist-packages/OpenSSL/test/ |
Upload File : |
ó
Ê£Mc @ s„ d Z d d l m Z d d l Z d d l Z d d l m Z m Z d d l m Z d e f d „ ƒ YZ
e d k r€ e ƒ n d S( s!
Unit tests for L{OpenSSL.rand}.
iÿÿÿÿ( t mainN( t TestCaset b( t randt RandTestsc B s e Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d
„ Z d „ Z
d „ Z d
„ Z d „ Z RS( c C sF | j t t j ƒ | j t t j d ƒ | j t t j d d ƒ d S( s
L{OpenSSL.rand.bytes} raises L{TypeError} if called with the wrong
number of arguments or with a non-C{int} argument.
i N( t assertRaisest TypeErrorR t bytest None( t self( ( s: /usr/lib/python2.7/dist-packages/OpenSSL/test/test_rand.pyt test_bytes_wrong_args s c C s¡ t j d ƒ } | j t | ƒ d ƒ t j d d ƒ } | j | | ƒ t j d d ƒ } | j t | ƒ d ƒ | j t t j d ƒ } | j t | ƒ d ƒ d S( 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.
i2 t num_bytesi iÿÿÿÿs num_bytes must not be negativeN( R R t assertEqualt lent assertNotEqualR t
ValueErrort str( R t b1t b2t b3t exc( ( s: /usr/lib/python2.7/dist-packages/OpenSSL/test/test_rand.pyt
test_bytes s c C sq | j t t j ƒ | j t t j t d ƒ d ƒ | j t t j d d ƒ | j t t j t d ƒ d d ƒ d S( s£
When called with the wrong number of arguments, or with arguments not of
type C{str} and C{int}, L{OpenSSL.rand.add} raises L{TypeError}.
t fooi N( R R R t addR R ( R ( ( s: /usr/lib/python2.7/dist-packages/OpenSSL/test/test_rand.pyt test_add_wrong_args, s c C s t j t d ƒ d ƒ d S( s?
L{OpenSSL.rand.add} adds entropy to the PRNG.
t hamburgeri N( R R R ( R ( ( s: /usr/lib/python2.7/dist-packages/OpenSSL/test/test_rand.pyt test_add7 s c C sL | j t t j ƒ | j t t j d ƒ | j t t j t d ƒ d ƒ d S( s’
When called with the wrong number of arguments, or with a non-C{str}
argument, L{OpenSSL.rand.seed} raises L{TypeError}.
R N( R R R t seedR R ( R ( ( s: /usr/lib/python2.7/dist-packages/OpenSSL/test/test_rand.pyt test_seed_wrong_args>