| Server IP : 138.197.176.125 / Your IP : 216.73.217.54 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/lib/python3/dist-packages/twisted/test/__pycache__/ |
Upload File : |
U
W[
� @ s| d Z ddlmZmZ ddlmZ ddlmZ G dd� de�Z G dd� de ej
�ZG d d
� d
e ej�Z
G dd� de ej�Zd
S )z-
Test cases for L{twisted.python.randbytes}.
� )�division�absolute_import)�unittest)� randbytesc @ s e Zd ZdZdd� ZdS )�SecureRandomTestCaseBasez1
Base class for secureRandom test cases.
c C sP t dd�D ]@}||�}| �t|�|� ||�}| �t|�|� | �||� q
dS )a|
The given random bytes source should return the number of bytes
requested each time it is called and should probably not return the
same bytes on two consecutive calls (although this is a perfectly
legitimate occurrence and rejecting it may generate a spurious failure
-- maybe we'll get lucky and the heat death with come first).
� � N)�range�assertEqual�lenZassertNotEqual)�self�source�nbytes�s�s2� r �=/usr/lib/python3/dist-packages/twisted/test/test_randbytes.py�_check s zSecureRandomTestCaseBase._checkN)�__name__�
__module__�__qualname__�__doc__r r r r r r s r c @ s e Zd ZdZdd� ZdS )�SecureRandomTestsz4
Test secureRandom under normal conditions.
c C s | � tj� dS )z�
L{randbytes.secureRandom} should return a string of the requested
length and make some effort to make its result otherwise unpredictable.
N)r r �secureRandom�r r r r �test_normal+ s zSecureRandomTests.test_normalN)r r r r r r r r r r &